Repository navigation
Closed
Labels
bugSomething is not working
Description
Describe the bug
The list tools call returns unnecessary fields. To me, this seems unintended.
To Reproduce
Declare a tool
/// Parameters for adding two numbers.
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
struct AddRequest {
/// The left-hand number.
a: f64,
/// The right-hand number.
b: f64,
}
/// Add two numbers.
#[rmcp::tool]
fn add(Parameters(AddRequest { a, b }): Parameters<AddRequest>) -> String {
(a + b).to_string()
}The list tools call currently returns
{
"name": "add",
"description": "Add two numbers.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Parameters for adding two numbers.",
"title": "AddRequest",
"type": "object",
"properties": {
"a": {
"description": "The left-hand number.",
"format": "double",
"type": "number"
},
"b": {
"description": "The right-hand number.",
"format": "double",
"type": "number"
}
},
"required": [
"a",
"b"
]
}
}Expected behavior
The same answer, but without the fields with Parameters for adding two numbers and AddRequest:
{
"name": "add",
"description": "Add two numbers.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"a": {
"description": "The left-hand number.",
"format": "double",
"type": "number"
},
"b": {
"description": "The right-hand number.",
"format": "double",
"type": "number"
}
},
"required": [
"a",
"b"
]
}
}Since 2020-12 is the default schema, we could even say that to minimize the answer the $schema can be omitted.
Reacted by Dale Seo
Metadata
Metadata
Assignees
Labels
bugSomething is not working
Activity