QuestionQ46

Tool Design & MCP Integration

An MCP server implements a check_availability tool that queries an external calendar API. During testing, three error conditions occur:

  1. The tool is invoked with a malformed request that lacks the required user_email parameter.
  2. The calendar API returns a 404 because the specified user does not exist in the calendar system.
  3. The calendar API returns a 503 because the service is temporarily unavailable.

How should each error be reported under MCP’s error-handling design?

Explanation

MCP uses JSON-RPC protocol errors for malformed tool-call requests, including invalid request structure or parameters. Failures encountered while an otherwise valid tool call executes—such as an external API reporting that a user is absent or temporarily unavailable—are tool execution errors and are returned in the tool result with isError: true.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!