Your search products tool queries an external catalog API that returns paginated results (50 items per request). Production logs show queries frequently match 200+ products, and the design that auto-fetches all pages causes 15-20 second delays. How should you redesign the pagination handling?
Answer(s): D
A: Create separate search products and fetch more results tools for pagination. Incorrect.This exposes pagination mechanics to the agent, increasing complexity and coupling tool usage with control flow.B: Implement server-side relevance ranking and return only the top 50 most relevant items. Incorrect.While this reduces latency, it removes access to the full result set , limiting flexibility when more results are actually needed.C: Add a max pages parameter (default: 2) that controls how many pages are fetched internally. Incorrect.This is an improvement over fetching everything, but it still hides pagination control inside the tool and may fetch unnecessary data.D: Return the first page with total match count and cursor for additional pages. Correct.This enables lazy loading and explicit control , allowing the agent to fetch more results only when needed— balancing performance and completeness.
Your search Flights tool calls an external airline API that occasionally returns a 503 Service Unavailable error. What is the most effective way to handle this error in your tool implementation?
A: Return an empty flight list as if the search succeeded but found no matching flights. Incorrect.This hides the failure and misleads the system into thinking no flights exist, which can lead to incorrect conclusions.B: Log the error internally and return an empty response, letting the model continue without the flight data. Incorrect.This still suppresses the failure signal, preventing the agent from taking corrective action.C: Return an error message in the tool result explaining the service is temporarily unavailable. Incorrect.While transparent, this alone doesn’t attempt recovery and may degrade user experience unnecessarily.D: Automatically retry the request up to five times with exponential backoff before returning results to the agent. Correct.This is the most effective approach—handles transient failures gracefully , improves reliability, and only surfaces errors if retries fail.
Your MCP server implements a check_availability tool that queries an external calendar API. During testing, you encounter three error conditions: (1) the tool is called with a malformed request, missing the required user_email parameter (2) the calendar API returns a 404 because the specified user doesn't exist in the calendar system (3) the calendar API returns a 503 because the service is temporarily unavailable. How should each error be reported according to MCP's error handling design?
Answer(s): C
A: Report all three as tool results with isError: true Incorrect.Malformed requests (error 1) are protocol-level issues , not tool execution results, so they should not be reported this way.B: Report errors 1 and 2 as JSON-RPC protocol errors, report error 3 as a tool result with isError: true Incorrect.A 404 (error 2) is a valid tool execution outcome (the user doesn’t exist), not a protocol error.C: Report error 1 as a JSON-RPC protocol error, report errors 2 and 3 as tool results with isError: true Correct.Error 1 (malformed request) → JSON-RPC protocol error (invalid input) Error 2 (user not found) → Tool result with isError: true (valid execution, meaningful failure) Error 3 (service unavailable) → Tool result with isError: true (transient external failure)D: Report all three as JSON-RPC protocol errors. Incorrect.Only malformed requests should be protocol errors; external API responses are tool-level outcomes , not protocol failures.
Your documents (query) tool returns results as "Found 3 documents: Q2 Budget Proposal, Q2 Budget Forecast, Annual Review". You want the agent to document (4, multi) and doc (24, multi). What return format would best enable these multi-step workflows?
Answer(s): B
A: URLs that users can click to open the document in their browser. Incorrect.URLs are useful for users, but not ideal for agents performing multi-step workflows that require reliable referencing and further operations .B: Structured data containing document IDs and metadata for each result. Correct.This enables the agent to programmatically reference specific documents (via IDs) across multiple steps, making workflows like follow-up queries or document retrieval precise and reliable.C: A JSON array of document titles extracted from the search results. Incorrect.Titles alone are ambiguous and not stable identifiers, making it difficult for agents to reliably act on specific documents.D: More detailed human-readable descriptions including the size and authors. Incorrect.Helpful for users, but still unstructured and not suitable for precise multi-step agent operations.
Your agent has access to 50+ specialized API connectors for different external services. As the connector library grew, tool selection accuracy dropped to 58%. You design a search_connectors(description) tool that finds matching connectors, but in testing agents frequently skip searching and call connectors directly (often incorrectly), or search select wrong connectors from the filtered results. How should you design the tool composition pattern to address both issues?
A: Design connectors with built-in compatibility validation that return descriptive errors for mismatched requests. Incorrect.This helps with error handling after a wrong choice is made, but does not improve initial tool selection accuracy .B: Design a find_and_execute(description, params) composite tool that searches and immediately executes the best matching connector. Incorrect.This removes transparency and control, making debugging harder and preventing the agent from reasoning about tool choice.C: Enhance all connector descriptions with detailed usage samples, edge cases, and input requirements. Add few-shot examples showing the correct search-then-use workflow. Incorrect.While helpful, this still relies on the agent to follow instructions and does not enforce correct behavior, especially at scale with 50+ tools.D: Design search_connectors to dynamically add matched connectors to the agent's available tools. Connectors start unavailable and persist once discovered. Correct.This enforces the search-first pattern by limiting available tools initially and reducing the decision space , improving both discovery and correct selection.
Post your Comments and Discuss Anthropic CCAR-F exam prep with other Community members: