Skip to content

[BUG] OpenRouter MCP Server Schema Validation Error #17097

Closed
@fedec65

Description

@fedec65

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 use
  • messages (array) - For chat completions
  • prompt (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

  1. Configure Claude Desktop to use the Pipedream OpenRouter MCP server
  2. Use the OPENROUTER-SEND-CHAT-COMPLETION-REQUEST function
  3. Provide valid parameters per OpenRouter's API:
    {
      "model": "google/gemini-2.5-pro-preview-05-06",
      "messages": [{"role": "user", "content": "Hello"}]
    }
  4. 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

Suggested Fix

Update the schema validation for the affected functions to expect:

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

added
triagedFor maintainers: This issue has been triaged by a Pipedream employee
on Jun 17, 2025
vunguyenhung

vunguyenhung commented on Jun 17, 2025

@vunguyenhung
Collaborator

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 case

self-assigned this
on Jun 19, 2025
moved this from Doing to Ready for PR Review in Component (Source and Action) Backlogon Jun 19, 2025
moved this from Ready for PR Review to In Review in Component (Source and Action) Backlogon Jun 24, 2025
moved this from In Review to Ready for QA in Component (Source and Action) Backlogon Jun 24, 2025
moved this from In QA to Ready for Release in Component (Source and Action) Backlogon Jun 25, 2025
vunguyenhung

vunguyenhung commented on Jun 25, 2025

@vunguyenhung
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriagedFor maintainers: This issue has been triaged by a Pipedream employee

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @michelle0927@vunguyenhung@fedec65

    Issue actions

      [BUG] OpenRouter MCP Server Schema Validation Error · Issue #17097 · PipedreamHQ/pipedream