QuestionQ44

Tool Design & MCP Integration

While implementing the lookup_order MCP tool, the backend occasionally returns errors (for example, “Order not found” or temporary database failures). What is the correct pattern for communicating these errors to the agent?

Explanation

MCP tool-execution errors, including API failures and business-logic errors such as a missing order, should be returned in the tool result’s content with isError: true. This exposes actionable feedback to the agent so it can respond appropriately or retry.

Learn more

Community Discussion

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