Skip to content

MCP Tool Schema mapping #2820

@afsalthaj

Description

@afsalthaj

Once the handshaking and done, the next integral part of the whole MCP is schema mapping to rmcp's JsonObject which is used for input and output schema of tool.

Here is the structure we need to follow. We will have an mcp_adaptor module, that has something like the following

use rmcp::model::JsonObject;

pub trait McpToolSchemaMapper {
    fn get_schema(&self) -> McpToolSchema;
}


pub struct McpToolSchema {
    pub input_schema: JsonObject,
    pub output_schema: Option<JsonObject>, // this is what RMCP expectsd
}

#[derive(Clone)]
pub struct AgentMcpTool {
    pub tool: AgentMethod, // this has all the details required 
}


impl McpToolSchemaMapper for AgentMcpTool {
    fn get_schema(&self) -> McpToolSchema { todo!() }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions