Skip to content

Dynamic MCP tool schema issue #285

@Sagnnik

Description

@Sagnnik

I was testing the dynamic mcp tools with gpt-5-mini. When I tried to look deeper, I noticed that the tool schemas are not what I expected.

Example:

[
   {
      "description":"Create a JavaScript-enabled tool that combines multiple MCP server tools. \nThis allows you to write scripts that call multiple tools and combine their results.\nUse the mcp-find tool to find servers and make sure they are are ready with the mcp-add tool. When running\nmcp-add, we don't have to activate the tools.\n",
      "inputSchema":{
         "type":"object",
         "required":[
            "servers",
            "name"
         ],
         "properties":{
            "name":{
               "type":"string",
               "description":"Name for the new code-mode tool (will be prefixed with 'code-mode-')"
            },
            "servers":{
               "type":"array",
               "description":"List of MCP server names whose tools should be available in the JavaScript environment",
               "items":{
                  "type":"string"
               }
            }
         }
      },
      "name":"code-mode"
   },
   {
      "description":"Execute a tool that exists in the current session. This allows calling tools that may not be visible in listTools results.",
      "inputSchema":{
         "type":"object",
         "required":[
            "name"
         ],
         "properties":{
            "arguments":{
               "type":[
                  "string",
                  "number",
                  "boolean",
                  "object",
                  "array",
                  "null"
               ],
               "description":"Arguments to pass to the tool (can be any valid JSON value)"
            },
            "name":{
               "type":"string",
               "description":"Name of the tool to execute"
            }
         }
      },
      "name":"mcp-exec"
   },
   {
      "description":"Find MCP servers in the current catalog by name, title, or description. Returns matching servers with their details.",
      "inputSchema":{
         "type":"object",
         "required":[
            "query"
         ],
         "properties":{
            "limit":{
               "type":"integer",
               "description":"Maximum number of results to return (default: 10)"
            },
            "query":{
               "type":"string",
               "description":"Search query to find servers by name, title, or description (case-insensitive)"
            }
         }
      },
      "name":"mcp-find"
   },
]

I am exposing these 3 tools to the LLM. But why are the arguments which are needed not mentioned for the LLM? Am I missing something?
Like I looked into the source code and code-mode needs code, servers, name, timeout and mcp-exec needs name from code-mode-{name} and script args. It does work with good system prompt however, but that's not reliable right?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions