Skip to content

Additional parameters are not passed through to tools #147

Open

Description

@au-re

Describe the bug
When you pass properties in the arguments of a tools/call message that are not defined in the schema, these are silently dropped from the args object.

To Reproduce

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const echoServer = new McpServer({
  name: "Echo",
  version: "1.0.0",
});

const schema = {
  message: z.string().describe("the message to echo"),
};

echoServer.tool("echo", "Echos the input message back", schema, async (args) => {
  console.log({ args });
  return { content: [{ type: "text", text: `Echo: ${props.message}` }] };
});

Call the echo tool with e.g.

{
  "method": "tools/call",
  "params": {
    "name": "echo",
    "arguments": {
      "message": "bar"
      "other": "foo"
    },
    "_meta": {
      "progressToken": 0
    }
  }
}

args will be { message: "bar" }

Expected behavior
It should be possible to pass additional properties to the tool.
This is the JSON Schema generated on the server, by default additionalProperties is set to true.

{
  "tools": [
    {
      "name": "echo",
      "description": "Echos the input message back",
      "inputSchema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "the message to echo"
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": true,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    }
  ]
}

Activity

  1. uncomplexity commented on Mar 11, 2025

    @uncomplexity

    Also how do we provide description to each tool?

    server.tool("add",
      { a: z.number(), b: z.number() },
      async ({ a, b }) => ({
        content: [{ type: "text", text: String(a + b) }]
      })
    );
  2. felixweinberger commented on Oct 24, 2025

    @felixweinberger
    Contributor

    Hi @au-re thanks for this report, apologies for the time it took to get back to this - is this still an issue for you?

  3. ghost removed
    needs confirmationNeeds confirmation that the PR is actually required or needed.
    on Apr 17, 2026
  4. ghost added
    ready for workEnough information for someone to start working on
    on Apr 17, 2026
  5. ghost added
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Apr 17, 2026
  6. ghost added
    fix proposedBot has a verified fix diff in the comment
    on Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingfix proposedBot has a verified fix diff in the commentready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions