Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Session breaks when MCP server tool call responds with 2+ content elements #3249

@tadasant

Description

@tadasant

Describe the bug

Whenever I trigger an MCP tool call that has has a response like:

{
  "content": [
    {
      "type": "text",
      "text": "..."
    },
    {
      "name": "https://github.com/",
      "uri": "memory://cleaned/github.com__20250703193348846",
      "description": "Scraped content from https://github.com/",
      "mimeType": "text/html",
      "type": "resource_link"
    }
  ]
}

(Note the two results inside content)

I get this in Goose in response, and my session is unable to proceed:

Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: messages.1: tool_use ids were found without tool_result blocks immediately after: toolu_0158xtsJTKrVh4mhXdjh55Nm. Each tool_use block must have a corresponding tool_result block in the next message..

Screenshot:

Image

This same issue does not occur on a response from the same MCP server with a tweaked tool call parameter that results in just 1 content block:

{
  "content": [
    {
      "type": "text",
      "text": "..."
    }
  ]
}

Screenshot:

Image

To Reproduce
Steps to reproduce the behavior:

  1. Set up the pulse-fetch server as a custom extension in Goose. Use [email protected] (I am soon bumping latest to refactor some of the tool call params, so this repro may become stale if you don't use 0.2.9)
  2. Prompt with something like fetch https://github.com/ with default tool call params
  3. You should get the error

Expected behavior
No error; successful tool call.

Please provide following information:

  • OS & Arch: macOS M4 Max
  • Interface: UI
  • Version: 1.0.31
  • Extensions enabled: pulse-fetch
  • Provider & Model: Anthropic claude-sonnet-4

Additional Information

Maybe related (but I don't think so?):

Metadata

Metadata

Assignees

Labels

mcpMCP/Extension relatedp1Priority 1 - High (supports roadmap)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions