Skip to content

MCP tool results with multiple content blocks — only first block is used #109

@tideberg

Description

@tideberg

Bug

When an MCP tool returns a result with multiple content blocks (multiple TextContent objects in the content array), auggie's LLM only sees the first block. The remaining blocks are silently discarded.

Impact

Any MCP tool that returns list[dict] via FastMCP produces one TextContent block per list element (this is FastMCP's _convert_to_content behavior). Auggie shows only the first element to the LLM, which reports incorrect/incomplete results with full confidence.

Reproduction

  1. Create an MCP tool that returns a list of dicts:
@mcp.tool()
def get_items() -> list[dict]:
    return [{"id": 1, "name": "A"}, {"id": 2, "name": "B"}, {"id": 3, "name": "C"}]
  1. Call from auggie: "how many items are there?"
  2. Auggie reports 1 item instead of 3.

Wire protocol evidence

The JSON-RPC response from the MCP server correctly contains all items as separate TextContent blocks in result.content[]:

{
  "result": {
    "content": [
      {"type": "text", "text": "{\"id\": 1, \"name\": \"A\"}"},
      {"type": "text", "text": "{\"id\": 2, \"name\": \"B\"}"},
      {"type": "text", "text": "{\"id\": 3, \"name\": \"C\"}"}
    ]
  }
}

Only the first content block reaches the LLM.

Expected behavior

All content blocks in a tool result should be concatenated (or otherwise made available) to the LLM, per the MCP spec which explicitly supports multiple content blocks per tool result.

Workaround

Wrap list returns in a single dict so FastMCP serializes them as one TextContent block:

@mcp.tool()
def get_items() -> dict:
    items = [{"id": 1, "name": "A"}, {"id": 2, "name": "B"}, {"id": 3, "name": "C"}]
    return {"count": len(items), "items": items}

Environment

auggie 0.21.0 (commit 2d5ea0cc)
FastMCP (via mcp Python SDK)
macOS, stdio transport

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions