QuestionQ34

Tool Design & MCP Integration

Your product-search tool queries an external catalog API and returns matching items. In production, the agent often retries searches immediately after receiving zero results, treating “no matches found” as a failure that requires a retry. The external API returns HTTP 200 with an empty results array—a valid response. How should you reorganize the tool’s result so the agent correctly interprets empty result sets?

Explanation

A successful catalog request can validly return no matching products. A structured response containing a success boolean and a results array explicitly represents that outcome as successful with empty data, whereas isError: true should indicate only actual tool-execution failures.

Community Discussion

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