Skip to content

Parameter schema generation not working - all tools show empty inputSchema #55

@avrabe

Description

@avrabe

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

  1. 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
    }
}
  1. Call tools/list method
  2. 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:

  1. Properly introspect parameter types that implement JsonSchema
  2. Generate correct JSON schemas during macro expansion
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions