MCP connection not retrieving full response when tool returns a list

I have connected a MCP to a chat in the prompts dashboard following the instructions here: https://platform.openai.com/docs/mcp#test-and-connect-your-mcp-server. It connects and calls the tools as expected. However, if the tool returns a list, it only considers the first value of the list instead of the whole list.

This breaks the usability of the MCP connection. I tested the exact same remote server in MCP Inspector and the whole list is properly returned by the tool:

I strongly suspect this is an issue with ChatGPT’s implementation of the MCP client, but let me know if there is some other reason for this behaviour.

I appreciate any help on this topic!

1 Like

Did you succeed to find a solution for this? I encounter the same problem with integration of my Custom MCP server.

I did find a solution in the end. It was inspired by the responses expected by the Apps SDK. The solution is to put the whole response in the structuredContent field. So the MCP response needs to look like this:

{
"structuredContent": {
"listOutput": [...]
}
}