Related: #19
Description
get_tool_params_description only iterates inputSchema["properties"] and never
reads inputSchema["required"], so every parameter is registered as required.
Calling a tool while omitting a genuinely optional parameter then fails, and
there is no way to satisfy both the gateway and the downstream server.
Reproduction
Notion MCP server, tool API-get-block-children, which has an optional
start_cursor parameter:
- Include
start_cursor: the caller has no value to send, so a placeholder
such as the string "undefined" is passed, and Notion rejects it:
query.start_cursor should be a valid uuid or 'undefined', instead was "undefined"
(Notion expects the JS undefined / field absence, which a Python caller
cannot express.)
- Omit
start_cursor: the gateway rejects the call because its generated
signature marks the parameter as required.
Either way the tool is uncallable.
Root cause
mcp_gateway/config.py → get_tool_params_description:
properties = tool.inputSchema.get("properties", {})
for param_name, param_schema in properties.items():
...
param_signatures.append((param_name, param_type, param_description))
# the "required" list is never read
Proposed fix
Read inputSchema.get("required", []), mark non-required parameters as optional
with a default, order required parameters before optional ones (so the resulting
inspect.Signature is valid), and drop unset optionals before forwarding the
call downstream.
Working implementation ready — will include it in the same PR as #19.
Related: #19
Description
get_tool_params_descriptiononly iteratesinputSchema["properties"]and neverreads
inputSchema["required"], so every parameter is registered as required.Calling a tool while omitting a genuinely optional parameter then fails, and
there is no way to satisfy both the gateway and the downstream server.
Reproduction
Notion MCP server, tool
API-get-block-children, which has an optionalstart_cursorparameter:start_cursor: the caller has no value to send, so a placeholdersuch as the string
"undefined"is passed, and Notion rejects it:undefined/ field absence, which a Python callercannot express.)
start_cursor: the gateway rejects the call because its generatedsignature marks the parameter as required.
Either way the tool is uncallable.
Root cause
mcp_gateway/config.py→get_tool_params_description:Proposed fix
Read
inputSchema.get("required", []), mark non-required parameters as optionalwith a default, order required parameters before optional ones (so the resulting
inspect.Signatureis valid), and drop unset optionals before forwarding thecall downstream.
Working implementation ready — will include it in the same PR as #19.