MCP Tool • Rust AI Agent SDK
MCPTool: An MCP tool definition.
MCPTool
Defined in the MCP module.
Rust AI Agent SDK
An MCP tool definition.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
agent["Agent"] -- "uses" --> tool["Tool: MCPTool"]
tool -- "returns" --> result["Result"]
style tool fill:#189AB4,color:#fff
style agent fill:#8B0000,color:#fff
style result fill:#8B0000,color:#fffFields
| Name | Type | Description |
|---|---|---|
name | String | Tool name |
description | String | Tool description |
input_schema | serde_json::Value | Input schema (JSON Schema) |
Methods
new
fn new(name: impl Into<String>, description: impl Into<String>) -> SelfCreate a new MCP tool
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
description | impl Into<String> |
input_schema
fn input_schema(mut self, schema: serde_json::Value) -> SelfSet input schema
Parameters:
| Name | Type |
|---|---|
schema | serde_json::Value |
Source
View on GitHubpraisonai/src/mcp/mod.rs at line 263