Skip to content

MCP responses use structuredContent instead of content, breaking Claude Code compatibility #5

@Merugokhale

Description

@Merugokhale

Description

The agentmail-mcp package returns tool results using the structuredContent field instead of the content field. This causes compatibility issues with Claude Code and other MCP clients that expect results in the content field.

Error

When calling any tool (e.g., list_inboxes, get_inbox), Claude Code returns:

MCP error -32602: Invalid tools/call result: [
  {
    "expected": "record",
    "code": "invalid_type",
    "path": ["structuredContent"],
    "message": "Invalid input: expected record, received string"
  }
]

Environment

  • agentmail-mcp version: 0.2.1
  • Client: Claude Code CLI
  • MCP server shows as "Connected" via claude mcp list

Expected Behavior

Tool results should be returned in a format compatible with the MCP specification that Claude Code can parse.

Related Issues

This appears to be a known issue affecting multiple MCP adapter libraries:

Workaround

Currently using the AgentMail REST API directly as a workaround.

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