-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
When using the #[mcp_tools]
macro with the PulseEngine MCP framework, all tools that have parameters show empty JSON schemas in the tools list response, even when parameter structs properly derive JsonSchema
.
Expected Behavior
Tools with parameters should show proper JSON schemas in the inputSchema
field when calling tools/list
. For example:
{"inputSchema": {
"type": "object",
"properties": {
"issue_key": {"type": "string", "description": "JIRA issue key"}
},
"required": ["issue_key"]
}}
Actual Behavior
All tools show empty schemas regardless of parameter structure:
{"inputSchema": {"properties": {}, "type": "object"}}
Steps to Reproduce
- Create a tool with parameters:
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct MyToolParams {
pub required_param: String,
pub optional_param: Option<i32>,
}
#[mcp_tools]
impl MyServer {
pub async fn my_tool(&self, params: MyToolParams) -> anyhow::Result<String> {
// implementation
}
}
- Call
tools/list
method - Observe empty
inputSchema.properties
Environment
- PulseEngine MCP Framework: v0.9.0 and v0.9.1
- Rust: 1.75+
- schemars: 0.8.22
- Used
#[derive(JsonSchema)]
on parameter structs
Impact
This prevents MCP clients from:
- Validating tool parameters
- Providing proper parameter hints/autocomplete
- Understanding tool interfaces
- Calling tools with parameters (some clients reject tools without schemas)
Possible Solution
The #[mcp_tools]
macro may need to:
- Properly introspect parameter types that implement
JsonSchema
- Generate correct JSON schemas during macro expansion
- Include schema information in tool registration
Test Case
A complete minimal reproduction case is available in our JIRA MCP server implementation at https://github.com/wunderfrucht/gouqi-mcp-server where we implemented attachment tools - all show empty schemas despite proper JsonSchema
derives.
Workaround Needed
Currently, clients cannot call tools with parameters because the framework rejects calls with "Missing required parameter 'params'" when the schema is empty, making parameterized tools unusable.