Closed
Description
Summary
The OpenRouter MCP server on mcp.pipedream.net has a schema validation error that prevents sending chat completion and completion requests to OpenRouter API.
Issue Details
Expected Behavior
According to OpenRouter's API documentation, requests should use:
model
(string) - The model ID to usemessages
(array) - For chat completionsprompt
(string) - For completions
Actual Behavior
The MCP server is expecting a models
parameter (plural, as an array) which doesn't exist in OpenRouter's API specification. This causes all chat completion and completion requests to fail with a validation error.
Error Message
{
"error": "AI_InvalidToolArgumentsError",
"message": "Invalid arguments for tool",
"validation_errors": [
{
"code": "invalid_type",
"expected": "array",
"received": "undefined",
"path": ["models"],
"message": "Required"
}
]
}
Steps to Reproduce
- Configure Claude Desktop to use the Pipedream OpenRouter MCP server
- Use the
OPENROUTER-SEND-CHAT-COMPLETION-REQUEST
function - Provide valid parameters per OpenRouter's API:
{ "model": "google/gemini-2.5-pro-preview-05-06", "messages": [{"role": "user", "content": "Hello"}] }
- Observe validation error expecting
models
array parameter
Root Cause Analysis
The MCP server appears to have incorrect schema validation that expects:
models: array
(incorrect - not part of OpenRouter API)
Instead of:
model: string
(correct - per OpenRouter documentation)
Affected Functions
OPENROUTER-SEND-CHAT-COMPLETION-REQUEST
OPENROUTER-SEND-COMPLETION-REQUEST
Working Functions
OPENROUTER-RETRIEVE-AVAILABLE-MODELS
(works correctly)
Environment
- Platform: Claude Desktop with MCP support
- MCP Server: https://mcp.pipedream.net
- OpenRouter API Version: v1
Suggested Fix
Update the schema validation for the affected functions to expect:
model
(singular, string) instead ofmodels
(plural, array)- Align with OpenRouter's official API specification: https://openrouter.ai/docs/api-reference
Additional Context
- The model listing function works correctly, confirming the connection to OpenRouter is functional
- This appears to be a simple schema mismatch rather than a deeper integration issue
- Users cannot use any OpenRouter models for actual inference through the MCP server due to this bug
Activity
vunguyenhung commentedon Jun 17, 2025
For component dev, I believe we need to update the
models
prop to match with the API specification. Please let me know if it's not the casevunguyenhung commentedon Jun 25, 2025
Hi everyone, all test cases are passed! Ready for release!
Test report
https://vunguyenhung.notion.site/BUG-OpenRouter-MCP-Server-Schema-Validation-Error-21cbf548bb5e81baa88efd64c9aab52f