Skip to content

[BUG]: outputSchema validation fails for upstream servers returning structuredContent (v1.0.0-RC2) #4042

@btbinaryjanitor

Description

@btbinaryjanitor

Description

Tool calls through ContextForge virtual servers (Streamable HTTP transport) fail with "Output validation error: outputSchema defined but no structured output returned" when the upstream MCP server returns both content and structuredContent. This appears to be a regression or incomplete fix of #1406.

Affected Version

v1.0.0-RC2 (deployed on Cloud Run)

Steps to Reproduce

  1. Register a Google BigQuery MCP gateway:

    • URL: https://bigquery.googleapis.com/mcp
    • Transport: STREAMABLEHTTP
    • Auth: OAuth client_credentials (via GCP token proxy)
  2. BigQuery MCP tools define outputSchema (large JSON Schema for table/dataset metadata)

  3. Call any tool through a ContextForge virtual server:

    {
      "jsonrpc": "2.0", "id": 2,
      "method": "tools/call",
      "params": {
        "name": "google-bigquery-list-dataset-ids",
        "arguments": {"projectId": "my-project"}
      }
    }
  4. Response:

    {
      "jsonrpc": "2.0", "id": 2,
      "result": {
        "content": [{"type": "text", "text": "Output validation error: outputSchema defined but no structured output returned"}],
        "isError": true
      }
    }

Expected Behavior

The tool call should succeed, passing through the upstream response including structuredContent.

Direct Call Works

Calling the same tool directly on https://bigquery.googleapis.com/mcp (bypassing ContextForge) returns correctly:

{
  "result": {
    "content": [{"text": "{}", "type": "text"}],
    "structuredContent": {}
  }
}

The upstream server IS returning structuredContent, but ContextForge strips it before validation, then fails the validation check.

Also Affects

  • Google Cloud Run MCP (https://run.googleapis.com/mcp) — all 5 tools define outputSchema
  • Likely any upstream MCP server that defines outputSchema on its tools

Relation to #1406

#1406 fixed streamablehttp_transport.py's call_tool to return structured content (merged via PR #1412, released in BETA-1). The error message is slightly different:

This suggests either a regression in RC2, or a second validation checkpoint that wasn't covered by the original fix.

Environment

  • ContextForge v1.0.0-RC2 on Google Cloud Run
  • Upstream: Google BigQuery MCP (bigquery.googleapis.com/mcp) and Google Cloud Run MCP (run.googleapis.com/mcp)
  • Transport: Streamable HTTP
  • Virtual server with tools from multiple gateways

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions