MCP tool result with multiple rows: only the last row is passed to the AI

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

MCP multi-row result: only the last row reaches the AI

Environment

  • Cursor (latest)

  • MCP server: genai-toolbox mysql prebuilt (toolbox --prebuilt mysql --stdio)

  • Config: .cursor/mcp.json → a MySQL MCP source pointing at a MySQL database

What happens

When an MCP tool (e.g. execute_sql) returns multiple rows, the raw MCP response in Cursor shows all rows (e.g. 4), but the model only ever sees the last row. The other rows are missing from the context passed to the AI.

Minimal repro

  1. Use the MySQL MCP tool to run a query that returns several rows, e.g.:

    SELECT platform, price_low, price_high

    FROM some_table

    WHERE name = ‘some_item’

    ORDER BY platform;

  2. The DB returns 4 rows (e.g. for platforms A, B, C, D).

  3. In Cursor’s tool output / raw MCP response you see all 4 rows.

  4. The AI’s replies are based only on one row—the last one (e.g. platform D).

COUNT(*)-style queries are fine (single row). The issue only appears when the tool returns multiple rows.

Expected

All rows from the MCP tool result are included in the context sent to the model, so the AI can use the full result (e.g. all 4 platforms).

Actual

Only the last row of the multi-row result is passed to the model. The rest are dropped somewhere between MCP → Cursor → model.

Ask

Can you check whether Cursor (or the MCP client layer) truncates or rewrites multi-row tool results and only forwards the last row? If so, could this be fixed so the full result is available to the model?

Thanks.

Steps to Reproduce

Set up MCP MySQL GitHub - googleapis/genai-toolbox: MCP Toolbox for Databases is an open source MCP server for databases.
Add a genai-toolbox mysql source (toolbox --prebuilt mysql --stdio) in .cursor/mcp.json and configure your MySQL connection.
Use a table with multiple rows
In any MySQL database, use a table that has at least a few rows (e.g. id, name, value), so SELECT * returns 2+ rows.
Run a multi-row query via MCP in Cursor
In a Cursor chat, ask the AI to use the MySQL MCP execute_sql tool with a query like:
SELECT id, name, value FROM your_table ORDER BY id LIMIT 5;
Ensure this query returns multiple rows (e.g. 5).
Check the raw MCP response
In Cursor’s MCP / tool-call output, inspect the raw response for that execute_sql call. Confirm it contains all rows (e.g. 5).
Compare with what the AI uses
See whether the AI’s follow-up replies use only one of those rows—specifically the last one. If the raw response has multiple rows but the AI’s answers clearly reflect only the last row, the bug is reproduced.
Expected: The AI uses all returned rows.
Actual: Only the last row is passed to the model; the others are missing.

Operating System

MacOS

Version Information

Version: 2.4.21
VSCode Version: 1.105.1
Commit: dc8361355d709f306d5159635a677a571b277bc0
Date: 2026-01-22T16:57:59.675Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a known issue with how Cursor handles MCP tools that return JSON arrays at the root level. There’s another report with the same behavior - JSON Array at Root Handled Incorrectly

The team is aware, but there’s no timeline yet. Your report helps with prioritization.

Workaround: Instead of returning a bare array [row1, row2, ...], wrap it in an object - {"rows": [row1, row2, ...]}. With this format, all elements are correctly passed to the model.

If you can’t change the MCP server response format (for example, if you’re using a prebuilt server), you might try creating an intermediate MCP tool that will do this wrapping.