Skip to content

Tracing client error 400 (MCP) #710

Not planned
Not planned
@MrNice124816

Description

@MrNice124816

Hi! I have such a problem, I have started several MCP servers, and any access to them gives the same error:
[non-fatal] Tracing client error 400: {
"error": {
"message": "Invalid type for 'data[1].span_data.result': expected an array of strings, but got null instead.",
"type": "invalid_request_error",
"param": "data[1].span_data.result",
"code": "invalid_type"
}
}

Here are the parts of my code:

///code
dexpaprika_server = MCPServerStdio(
params={
"command": "npx",
"args": ["dexpaprika-mcp"],
},
cache_tools_list=True,
name="DexPaprika"
)
...
dex_agent = Agent(
name="Crypto Analytics Agent",
instructions="""You are an expert in cryptocurrency analytics and market data.
Your task is to provide accurate information on crypto tokens, DEX trading activity,
and liquidity across multiple blockchains.
""",
model=MAIN_AGENT_MODEL,
mcp_servers=[dexpaprika_server]
)
...
main_agent = Agent(
name="Assistant",
instructions=main_instructions.format(CURRENT_DATE, CURRENT_DATE, CURRENT_DATE),
model=MAIN_AGENT_MODEL,
tools=[
dex_agent.as_tool(
tool_name="crypto_analytics",
tool_description="Analyze cryptocurrency data, tokens, DEX trading activity, and liquidity across multiple blockchains. Use this tool for questions related to crypto markets, tokens, DeFi, or blockchain analytics. When using this tool, do not specify the year in your queries."
)
]
)
///code

What am I doing wrong?

I also noticed that there is no information about accessing the MCP in Traces, but the information is in the logs.:
Function call
Arguments
crypto_analytics({
"input": "Analyze JUP token on Solana. Fetch price, volume, and top liquidity pools."
})
Output
No output

Activity

AreebaxIrfan

AreebaxIrfan commented on May 17, 2025

@AreebaxIrfan

The error message you're encountering indicates that the span_data.result field is expected to be an array of strings, but it's receiving a null value instead. This often arises from mismatched data types between your tool's output and the expected schema.

Steps to Resolve:

Check Output Format: Ensure that your MCP tool's output matches the expected schema. For instance, if the schema expects an array of strings, verify that your tool returns data in this format.

Validate Input Types: Confirm that the inputs to your MCP tool are correctly typed. For example, if a parameter expects a list of strings, ensure that you're passing a list and not a single string or null.

Review MCP Server Logs: Examine the MCP server logs for any warnings or errors related to input validation or type mismatches. This can provide more context on where the issue originates.

Test with Simple Inputs: Test your MCP tool with simple, known-good inputs to isolate whether the issue is with the tool's logic or the data being passed to it.

By ensuring that your tool's outputs and inputs align with the expected types and reviewing the server logs for additional context, you should be able to resolve the invalid_type error.

github-actions

github-actions commented on May 25, 2025

@github-actions

This issue is stale because it has been open for 7 days with no activity.

github-actions

github-actions commented on May 29, 2025

@github-actions

This issue was closed because it has been inactive for 3 days since being marked as stale.

Aura-AI-founder

Aura-AI-founder commented on Jun 16, 2025

@Aura-AI-founder

This issue is happening if the server has been idle for some time. Can you point me on how to identify if sse is disconnected from the app?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about using the SDKstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @AreebaxIrfan@Aura-AI-founder@MrNice124816

        Issue actions

          Tracing client error 400 (MCP) · Issue #710 · openai/openai-agents-python