pub struct ToolContext {
pub server_id: String,
pub name: String,
pub name_literal: String,
pub server_id_literal: String,
pub typescript_name: String,
pub description: String,
pub input_schema: Value,
pub properties: Vec<PropertyInfo>,
pub category: Option<String>,
pub keywords: Option<String>,
pub short_description: String,
}Expand description
Context for rendering a single tool template.
Contains all data needed to generate one tool file in the progressive loading pattern.
§Examples
use mcp_execution_codegen::progressive::ToolContext;
use serde_json::json;
let context = ToolContext {
server_id: "github".to_string(),
name: "create_issue".to_string(),
name_literal: "create_issue".to_string(),
server_id_literal: "github".to_string(),
typescript_name: "createIssue".to_string(),
description: "Creates a new issue".to_string(),
input_schema: json!({"type": "object"}),
properties: vec![],
category: Some("issues".to_string()),
keywords: Some("create,issue,new,bug".to_string()),
short_description: "Create a new issue".to_string(),
};
assert_eq!(context.server_id, "github");Fields§
§server_id: StringMCP server identifier, sanitized for safe embedding in a JSDoc comment
name: StringOriginal tool name (snake_case), sanitized for safe embedding in a JSDoc comment
name_literal: StringOriginal tool name escaped for safe embedding in a single-quoted TS string literal
server_id_literal: StringServer identifier escaped for safe embedding in a single-quoted TS string literal
typescript_name: StringTypeScript-friendly name (camelCase), sanitized to a safe identifier
description: StringHuman-readable description
input_schema: ValueJSON Schema for input parameters, with description fields sanitized
for safe interpolation into JSDoc block comments (see issue #102).
properties: Vec<PropertyInfo>Extracted properties for template rendering
category: Option<String>Optional category for tool grouping
keywords: Option<String>Optional keywords for discovery via grep/search
short_description: StringShort description for header comment. Always populated: ProgressiveGenerator’s only
constructor falls back to description when no categorization short description is
available, so None is not a state this type can represent.
Trait Implementations§
Source§impl Clone for ToolContext
impl Clone for ToolContext
Source§fn clone(&self) -> ToolContext
fn clone(&self) -> ToolContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more