API Returns 424 Error for MCP Calls

I’m having an issue with integrating an MCP server during testing. To try and simplify this I am at the point of the simplest schema and request for it and I’ve removed all our code and am just testing through the API playground and get the same results.

The server is HTTPS (but not on 443). The endpoint is SSE.

The call to list tools works fine, it then makes a call to the simple tool with correct query params.

I can see on our server the response is returned and processed gracefully with no disconnections.

The API then returns a tool failure: 424: unhandled errors in a TaskGroup (1 sub-exception)

This server works with MCP Inspector and also works when attached to Claude.

Attempted on a few models.

The only weird thing in all this I can think of is not using 443 - but the MCP is called, response is returned and only then does error happen.

For sake of clarity here is the request/response schema - I’ve gone from a set of super simple tools to “about as simple as it gets” and we’re still getting the issue.

{
  "type": "object",
  "properties": {
    "result": {
      "type": "string",
      "nullable": true
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#",
  "additionalProperties": false
}
{
  "result": "You searched for: test"
}

Auth is bearer token (and working/provided fine).

SSL cert is fine, connection is public, no connection resets, SSE is fine for everything else, it’s got minimal proxying (just border SSL offload) and no buffering or anti-SSE HTTP patterns inbetween.

Attached view of playground.

Full stack of API calls:

{
    "type": "response.created",
    "sequence_number": 0,
    "response": {
        "id": "resp_68a756202cb08196aa37b4d8eb91b5250153f9a2f86d22ba",
        "object": "response",
        "created_at": 1755797024,
        "status": "in_progress",
        "background": false,
        "error": null,
        "incomplete_details": null,
        "instructions": null,
        "max_output_tokens": null,
        "max_tool_calls": null,
        "model": "gpt-4o-2024-08-06",
        "output": [],
        "parallel_tool_calls": true,
        "previous_response_id": null,
        "prompt_cache_key": null,
        "reasoning": {
            "effort": null,
            "summary": null
        },
        "safety_identifier": null,
        "service_tier": "auto",
        "store": true,
        "temperature": 1,
        "text": {
            "format": {
                "type": "text"
            },
            "verbosity": "medium"
        },
        "tool_choice": "auto",
        "tools": [
            {
                "type": "mcp",
                "allowed_tools": null,
                "headers": {
                    "Authorization": "<redacted>"
                },
                "require_approval": "never",
                "server_description": null,
                "server_label": "Orchestrator",
                "server_url": "https://UrlRedacted/<redacted>"
            }
        ],
        "top_logprobs": 0,
        "top_p": 1,
        "truncation": "disabled",
        "usage": null,
        "user": null,
        "metadata": {}
    }
},
{
    "type": "response.in_progress",
    "sequence_number": 1,
    "response": {
        "id": "resp_68a756202cb08196aa37b4d8eb91b5250153f9a2f86d22ba",
        "object": "response",
        "created_at": 1755797024,
        "status": "in_progress",
        "background": false,
        "error": null,
        "incomplete_details": null,
        "instructions": null,
        "max_output_tokens": null,
        "max_tool_calls": null,
        "model": "gpt-4o-2024-08-06",
        "output": [],
        "parallel_tool_calls": true,
        "previous_response_id": null,
        "prompt_cache_key": null,
        "reasoning": {
            "effort": null,
            "summary": null
        },
        "safety_identifier": null,
        "service_tier": "auto",
        "store": true,
        "temperature": 1,
        "text": {
            "format": {
                "type": "text"
            },
            "verbosity": "medium"
        },
        "tool_choice": "auto",
        "tools": [
            {
                "type": "mcp",
                "allowed_tools": null,
                "headers": {
                    "Authorization": "<redacted>"
                },
                "require_approval": "never",
                "server_description": null,
                "server_label": "Orchestrator",
                "server_url": "https://UrlRedacted/<redacted>"
            }
        ],
        "top_logprobs": 0,
        "top_p": 1,
        "truncation": "disabled",
        "usage": null,
        "user": null,
        "metadata": {}
    }
},
{
    "type": "response.output_item.added",
    "sequence_number": 2,
    "output_index": 0,
    "item": {
        "id": "mcpl_68a75620853c8196a49404114463ba7c0153f9a2f86d22ba",
        "type": "mcp_list_tools",
        "server_label": "Orchestrator",
        "tools": []
    }
},
{
    "type": "response.mcp_list_tools.in_progress",
    "sequence_number": 3,
    "output_index": 0,
    "item_id": "mcpl_68a75620853c8196a49404114463ba7c0153f9a2f86d22ba"
},
{
    "type": "response.mcp_list_tools.completed",
    "sequence_number": 4,
    "output_index": 0,
    "item_id": "mcpl_68a75620853c8196a49404114463ba7c0153f9a2f86d22ba"
},
{
    "type": "response.output_item.done",
    "sequence_number": 5,
    "output_index": 0,
    "item": {
        "id": "mcpl_68a75620853c8196a49404114463ba7c0153f9a2f86d22ba",
        "type": "mcp_list_tools",
        "server_label": "Orchestrator",
        "tools": [
            {
                "annotations": {
                    "read_only": false
                },
                "description": "Search for a file, just enter the query and get some results!",
                "input_schema": {
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string",
                            "description": "The query to use to search documents for.",
                            "minLength": 1
                        }
                    },
                    "required": [
                        "query"
                    ],
                    "additionalProperties": false
                },
                "name": "FileSearch"
            }
        ]
    }
},
{
    "type": "response.output_item.added",
    "sequence_number": 6,
    "output_index": 1,
    "item": {
        "id": "mcp_68a75636e7408196a692b078b82ecb360153f9a2f86d22ba",
        "type": "mcp_call",
        "approval_request_id": null,
        "arguments": "",
        "error": null,
        "name": "FileSearch",
        "output": null,
        "server_label": "Orchestrator"
    }
},
{
    "type": "response.mcp_call.in_progress",
    "sequence_number": 7,
    "output_index": 1,
    "item_id": "mcp_68a75636e7408196a692b078b82ecb360153f9a2f86d22ba"
},
{
    "type": "response.mcp_call_arguments.delta",
    "sequence_number": 8,
    "output_index": 1,
    "item_id": "mcp_68a75636e7408196a692b078b82ecb360153f9a2f86d22ba",
    "delta": "{\"query\":\"test\"}",
    "obfuscation": ""
},
{
    "type": "response.mcp_call_arguments.done",
    "sequence_number": 9,
    "output_index": 1,
    "item_id": "mcp_68a75636e7408196a692b078b82ecb360153f9a2f86d22ba",
    "arguments": "{\"query\":\"test\"}"
},
{
    "type": "response.mcp_call.failed",
    "sequence_number": 10,
    "output_index": 1,
    "item_id": "mcp_68a75636e7408196a692b078b82ecb360153f9a2f86d22ba"
},
{
    "type": "response.output_item.done",
    "sequence_number": 11,
    "output_index": 1,
    "item": {
        "id": "mcp_68a75636e7408196a692b078b82ecb360153f9a2f86d22ba",
        "type": "mcp_call",
        "approval_request_id": null,
        "arguments": "{\"query\":\"test\"}",
        "error": {
            "type": "http_error",
            "code": 424,
            "message": "424: unhandled errors in a TaskGroup (1 sub-exception)"
        },
        "name": "FileSearch",
        "output": null,
        "server_label": "Orchestrator"
    }
}
1 Like

Hi,

I’m having the same problem. Have you found a solution?

Alexandre

No, I had to end up translating MCP into tool calls to get this to work at all.

I finally found the issue.

I defined an “output schema” but the structuredContent was missing in the response.

I saw it with the tool “MCP inspector”

1 Like

I’ve fixed this by returning structured data from the tool instead of text.

1 Like