pub struct ToolContext {
pub server_id: String,
pub name: 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: Option<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(),
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: Some("Create a new issue".to_string()),
};
assert_eq!(context.server_id, "github");Fields§
§server_id: StringMCP server identifier
name: StringOriginal tool name (snake_case)
typescript_name: StringTypeScript-friendly name (camelCase)
description: StringHuman-readable description
input_schema: ValueJSON Schema for input parameters
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: Option<String>Optional short description for header comment
Trait Implementations§
Source§impl Clone for ToolContext
impl Clone for ToolContext
Source§fn clone(&self) -> ToolContext
fn clone(&self) -> ToolContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolContext
impl Debug for ToolContext
Source§impl<'de> Deserialize<'de> for ToolContext
impl<'de> Deserialize<'de> for ToolContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ToolContext
impl RefUnwindSafe for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnwindSafe for ToolContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more