Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

MCP clients like n8n send additional metadata properties (action, chatInput, sessionId, toolCallId) with tool calls. The MCP SDK's default strict Zod validation rejects these, breaking integrations.

Changes

  • New utility: createPassthroughSchema() wraps Zod shapes with .passthrough() to allow unknown properties
  • Updated all 18 tool registrations across workouts, routines, templates, folders, and webhooks to use passthrough validation

Usage

// Before: strict validation rejects extra props
server.tool("get-workouts", "...", {
  page: z.number(),
});

// After: extra props pass through
server.tool("get-workouts", "...", createPassthroughSchema({
  page: z.number(),
}));

Tool parameters are still validated; unknown properties are simply ignored rather than causing errors.

Original prompt

This section details on the original issue you should resolve

<issue_title>Ignore extra params passed to the tool</issue_title>
<issue_description>When using n8n, for example, it aways sends some default tools args. This is breaking the execution. Can you make the mcp server ignore those extra params instead of failing in the validation ?

Here the error on n8n

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

✨ PR Description

Purpose: Fix MCP server tools to ignore unexpected parameters by implementing a passthrough schema helper that prevents validation errors from metadata properties.

Main changes:
- Added createPassthroughSchema utility to allow extra properties in tool parameter validation
- Replaced all tool schema definitions with passthrough-enabled schemas across multiple tool files
- Added comprehensive test suite for the new schema helper functionality

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

This fix allows MCP clients like n8n to pass additional metadata
parameters (action, chatInput, sessionId, toolCallId) without
causing validation errors. The createPassthroughSchema utility
wraps Zod schemas with .passthrough() to allow unknown properties.

Co-authored-by: chrisdoc <[email protected]>
Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ PR Review

LGTM

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

Copilot AI changed the title [WIP] Fix mcp server to ignore extra parameters Ignore extra params passed to MCP tools Nov 29, 2025
Copilot AI requested a review from chrisdoc November 29, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore extra params passed to the tool

2 participants