21 Tool Design & MCP Integration Practice Questions & Answers
Every Tool Design & MCP Integration practice question from the Claude Certified Architect – Foundations Practice Test, with the correct answer and a short explanation.
Start practice test →1. A multi-agent research pipeline exposes analyze_content and analyze_document, each described in a single line as analyzing the supplied material. In testing, web search results are routed to analyze_document roughly 40% of the time. What is the most effective first step?
- A.Add a system prompt rule stating that web search results always go to analyze_content while PDF uploads go to analyze_document.
- B.Insert a deterministic keyword router ahead of the model that inspects the input and calls the matching tool directly.
- C.Merge the two into a single analyze tool with a source_type parameter that the calling code sets on every request.
- D.Expand each description with its purpose, accepted input formats, example calls, and when the other tool applies instead.✓ Answer
The tool description is the primary signal the model uses to choose among tools, so near-identical one-line descriptions leave nothing to discriminate on and no amount of system prompt instruction repairs that. Expanding the descriptions with purpose, input formats, examples and explicit boundaries against the sibling tool addresses the actual root cause; a keyword router and a merged mega-tool are larger changes that are disproportionate to a description defect.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.1 (tool descriptions as the primary tool-selection mechanism)Report a problem with this question
2. You are reviewing tool definitions for a customer support agent. Which combination of content in a tool description most improves the model's tool-selection reliability?
- A.A version number, the owning team, and a changelog of the parameters added or removed since it shipped.
- B.Boundaries against similar tools, accepted input formats, example queries, and when the tool should not be used.✓ Answer
- C.The implementation language, the internal service it calls, and the average latency of a successful call in production.
- D.A warning that the tool is costly, plus an instruction to think carefully before deciding to call it.
A tool description is prompt engineering aimed at a reader who cannot see the implementation, so it must answer what the tool does, when to use it, when not to, what input it accepts and how it differs from its neighbours. Implementation internals, ownership metadata and latency figures never enter the model's selection decision, and a vague caution to think carefully does not tell the model which tool fits the request.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.1 (effective tool interfaces and boundaries)Report a problem with this question
3. A support agent's process_refund tool takes amount and reason as free-form strings. Calls fail intermittently because the model sends values such as "$50.00", "50 dollars" or "50.00", and reason text the policy engine does not recognise. What is the best change to the tool interface?
- A.Keep both as strings and instruct the model in the system prompt to strip currency symbols before each call.
- B.Type amount as a number in a stated currency and reason as an enum of the categories the refund policy allows.✓ Answer
- C.Keep the current signature and have the tool retry with a cleaned value whenever its first parse of the amount fails.
- D.Add a validate_refund_input tool that the agent is instructed to call before every process_refund request.
Good tool parameters are hard to get wrong by construction: a numeric field in a declared currency removes the formatting ambiguity entirely, and an enum removes free-text reasons the policy engine cannot map. Prompt instructions and defensive cleanup inside the tool both leave the ambiguous surface in place and carry a non-zero failure rate, while a separate validation tool adds a call the schema itself should have made unnecessary.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.1 (input contracts and parameter design)Report a problem with this question
4. After both tool descriptions were expanded, an agent still calls search_kb for order-status questions whenever the customer's message contains the word "policy". The system prompt contains the line "always search the knowledge base for policy questions." What is the correct diagnosis and fix?
- A.The system prompt's keyword wording created an unintended tool association, so restate that instruction as a condition.✓ Answer
- B.The descriptions are still too short, so add several more sentences of edge-case detail to both of the tools.
- C.The model lacks examples, so add few-shot turns showing an order question answered without a knowledge base call.
- D.The tool set is too large, so remove search_kb from this agent and send every policy question to the coordinator.
System prompt text competes with tool descriptions, and an instruction keyed to a surface word teaches the model to fire on that word rather than on the user's actual intent, overriding otherwise good descriptions. The fix is to review the prompt for keyword-sensitive phrasing and restate the rule as the condition it means, since more description detail, few-shot turns and removing the tool all leave the offending instruction in place.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.1 (system prompt wording and unintended tool associations)Report a problem with this question
5. A single analyze_document tool is used for data extraction, summarization and claim verification, and its output shape varies from call to call. Which change best follows the guide's tool-design principle?
- A.Raise the sampling temperature on the single tool so the model explores more analysis strategies.
- B.Replace it with purpose-specific tools whose input and output contracts each cover a single job.✓ Answer
- C.Append the requested analysis mode to the document text that is passed into the single tool.
- D.Wrap the single tool in a second tool that re-runs it and returns whichever output is fuller.
A tool that serves three different jobs gives the model no stable contract to reason about, and the resulting output shape is unpredictable for the code that consumes it. Splitting it so that each tool has one purpose and one defined output contract removes the selection ambiguity, whereas smuggling a mode into the document text, changing sampling behaviour or double-running the analysis leave the overloaded interface untouched.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.1 (purpose-specific tools with defined I/O contracts)Report a problem with this question
6. A research subagent must report two different situations: a source that stayed unreachable after retries, and a search that ran successfully but matched no papers. How should each be represented in the MCP tool response?
- A.Both cases return isError false, since the subagent finished its turn and the coordinator decides.
- B.An unreachable source returns isError false with a note; a zero-match search returns isError true to retry.
- C.Both cases return isError true, since either way the coordinator received no content it can use.
- D.An unreachable source returns isError true; a search that matched nothing returns isError false with an empty set.✓ Answer
An unreachable source means the question was never answered, so the coordinator must retry or substitute a source; a search that reached the source and matched nothing is a completed, valid answer that synthesis can record. Because the two demand opposite downstream behaviour, isError must distinguish them, and collapsing them into one flag destroys the information the coordinator needs to recover.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.2 (isError semantics vs. empty result sets)Report a problem with this question
7. A coordinator receives a subagent response with isError set to false and an empty results array. What should the coordinator do?
- A.Retry the same subagent with the identical query, since an empty payload usually signals a truncated response.
- B.Mark the source unavailable and substitute another one, since no content means the lookup failed.
- C.Treat the empty set as a valid finding, note that the source was searched, and continue to synthesis.✓ Answer
- D.Halt the pipeline and escalate to a human, since absence of data cannot be told apart from failure.
isError false with zero results states that the tool ran, reached the source and found nothing matching, which is a real answer about the world rather than a failure of the call. Retrying an identical query that already succeeded wastes a turn and produces the same empty set, and treating the source as unavailable or escalating misreports a successful lookup as an outage.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.2 (empty results are a valid answer, not a failure)Report a problem with this question
8. Every tool on an MCP server returns the same message, "Operation failed", with isError set to true. The agent now retries policy violations indefinitely and gives up on transient timeouts. What is the most effective fix?
- A.Return an error category, a machine-readable retryability flag, and a readable description.✓ Answer
- B.Have each tool return its raw stack trace so the agent can read the exception type and decide.
- C.Move failure handling into the system prompt, listing which tools may be retried and which may not.
- D.Cap the agent at three retries per tool call and end the turn once that cap has been reached.
A uniform error string strips the agent of the only information that distinguishes a recoverable timeout from a business rule it must never retry, so recovery becomes guesswork. Structured metadata that names the class of failure, states machine-readably whether the call may be retried, and explains the situation in plain language lets the agent choose the right recovery per case; a retry cap and prompt-level lists only mask the missing signal.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.2 (structured error responses: category, retryability, description)Report a problem with this question
9. A research subagent queries four sources. One timed out and succeeded on retry; another returned a service-unavailable response on three consecutive attempts. What should the subagent return to the coordinator?
- A.The results it recovered plus a structured note naming the source it could not reach and the attempts made.✓ Answer
- B.An empty result set marked successful, so the synthesis step is not blocked by one unavailable source.
- C.A single failure notice to the coordinator, so the coordinator can decide whether the whole task should be retried.
- D.Every timeout and retry it performed, so the coordinator holds a full transcript of the subagent's tool calls.
Subagents are expected to recover locally from transient failures and to propagate upward only what they could not resolve, together with partial results and a record of what was attempted. Reporting a single blanket failure discards three good sources, returning empty-as-success hides a coverage gap the synthesis will silently inherit, and forwarding every retry floods the coordinator's context with detail it cannot act on.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.2 (local recovery and error propagation with partial results)Report a problem with this question
10. During an agent loop, one of three tools invoked in a single assistant turn throws an exception inside your own tool-execution code. What must the loop send back to the model?
- A.An assistant text block describing the exception, so the model reads it as part of its reasoning.
- B.A tool_result block carrying the failing tool_use id and marked as an error, appended to the history.✓ Answer
- C.Nothing for that call, plus a new user message restating the request so another tool is chosen.
- D.Results only for the calls that succeeded, letting the model infer the missing one from the ids.
The tool-use contract requires that every tool_use id be answered by a matching tool_result, so a failed tool still returns a result block flagged as an error rather than being dropped. Omitting the block leaves an unanswered id and breaks the turn, and reporting the failure as assistant text or as a fresh user message gives the model no way to associate the failure with the specific call it made.
Source: Anthropic tool use documentation: tool_result must match every tool_use id; failed tools return is_error resultsReport a problem with this question
11. A single customer support agent holds eighteen tools, and selection accuracy has degraded noticeably as the set grew. What is the most effective restructuring?
- A.Shorten every one of the eighteen descriptions to a single line so the set costs less context.
- B.Order the eighteen by expected call frequency so the most-used tools appear first in the array.
- C.Keep all eighteen on one agent and add a system prompt section explaining when each tool should be picked.
- D.Split the work across role-scoped agents holding only the four or five tools their role needs.✓ Answer
Selection reliability falls as the candidate set grows, so the remedy is to shrink what any one agent must choose among by giving each role only the tools its work requires. Ordering the array does not change the number of candidates, shortening descriptions removes the very detail that makes selection reliable, and a prompt section restating eighteen tools competes with the descriptions instead of reducing the choice.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.3 (scoped tool access and least privilege)Report a problem with this question
12. A structured extraction service sometimes receives a prose answer instead of a tool call, which breaks the downstream parser. Which tool_choice configuration guarantees that the model emits a tool call?
- A.tool_choice set to "any", which requires a tool call while leaving the choice of tool open.✓ Answer
- B.tool_choice set to "none", which suppresses tools so the model returns the fields as plain text.
- C.tool_choice set to "auto", which lets the model answer in text whenever no tool seems needed.
- D.tool_choice left unset, so the provider default applies and either a tool call or text is allowed.
"any" forces the turn to contain a tool call while still letting the model pick which tool fits, which is exactly what a parser that expects structured arguments requires. "auto" and the unset default both permit a plain text answer, and "none" removes tools altogether, returning the service to the free-form prose that caused the failure.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.3 (tool_choice: auto, any, forced tool)Report a problem with this question
13. An enrichment workflow requires extract_metadata to run before any enrichment tool is called. What is the most reliable way to guarantee that ordering?
- A.State the required order in the system prompt and leave tool_choice on its permissive default setting.
- B.List extract_metadata first in the tools array so the model reaches it before the others.
- C.Merge extraction and enrichment into one tool so the ordering is fixed inside the code.
- D.Force that named tool on the first turn, then let the following turns choose among the enrichment tools.✓ Answer
Forcing a specific tool by name makes the first turn deterministic, and the remaining steps are then handled in follow-up turns where the model chooses freely. Array position carries no ordering guarantee, prompt instructions have a non-zero failure rate under a permissive tool_choice, and merging the two stages removes the flexibility the enrichment step needs.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.3 (forced tool selection to guarantee ordering)Report a problem with this question
14. An agent's tool surface has grown large enough that the definitions themselves consume a significant share of the context window. What is the rule when tool definitions are deferred and retrieved on demand?
- A.Definitions may be deferred entirely, with an empty tools array and discovery handled by the prompt.
- B.Definitions may be deferred only for a static tool set, and the whole set reloads on every single request.
- C.Definitions may be deferred and fetched by a search tool, but at least one tool stays loaded.✓ Answer
- D.Definitions may be deferred per turn, so the model sees a different subset of tools on each turn.
Deferring definitions trades upfront context for an on-demand lookup, but the model still needs a loaded entry point through which to perform that lookup, so at least one tool must remain in the request. An entirely empty tools array leaves the model with no mechanism to discover anything, and neither a static-set restriction nor a per-turn reshuffle describes how deferral actually works.
Source: Anthropic tool use documentation: deferred tool definitions with on-demand tool search require at least one loaded toolReport a problem with this question
15. A model returns three tool_use blocks in one assistant turn and your harness executes them concurrently. How must the results be returned to the model?
- A.The three results are concatenated into one tool_result that cites the first call's id.
- B.The results return in one user message with the ids omitted, since their order already matches.
- C.All three tool_result blocks return in one user message, each carrying the id it answers.✓ Answer
- D.Each tool_result returns in its own user message, in the order the three tools finished.
All tool results for one assistant turn belong in a single user message, with each block referencing the tool_use id it answers, because that is how the model sees its parallel calls resolved together. Splitting them across separate messages teaches the model that parallel calls are not answered as a batch and suppresses future parallel calling, while concatenating or omitting ids breaks the id-matching requirement outright.
Source: Anthropic tool use documentation: all tool_result blocks for one assistant turn go in a single user messageReport a problem with this question
16. Your agent uses a server-side tool that executes on the provider's infrastructure and returns its output within the same response. How does the calling code learn that this tool failed?
- A.The failure arrives as a result block in the same response, so the caller branches on its shape.✓ Answer
- B.The response omits that block, so the caller detects the failure by comparing counts to its request.
- C.The caller must send its own tool_result for the failure, exactly as it does for a hosted tool.
- D.The request raises an API error, so the caller catches it and retries the whole message request.
A server-side tool runs inside the provider's turn, so its outcome, including failure, comes back as a result block in that same response rather than as a transport-level exception. The caller therefore has to inspect the shape of the returned block instead of relying on a raised error, and it never supplies a tool_result of its own for a tool it did not execute.
Source: Anthropic tool use documentation: server-side (provider-executed) tools report failures as result blocks in the same responseReport a problem with this question
17. A team's shared Jira MCP server is configured in each developer's ~/.claude.json. New teammates clone the repository and find that none of the Jira tools are available. What is the correct fix?
- A.Leave the entry where it is and document the required tools in the project's root CLAUDE.md.
- B.Have each teammate copy the same block into their own ~/.claude.json after cloning the repo.
- C.Move the server entry into a project .mcp.json committed with the repository so every clone loads it.✓ Answer
- D.Move the entry into the repository's .claude/settings.json, the only file MCP servers load from.
User-level configuration in ~/.claude.json is personal to one machine and is never distributed with the code, which is exactly why a new clone sees no Jira tools. Shared team tooling belongs in a project-level .mcp.json that is committed alongside the repository, so every checkout gets the same servers; manual copying reintroduces the drift and documentation alone configures nothing.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.4 (project .mcp.json vs. user ~/.claude.json scoping)Report a problem with this question
18. A project-level .mcp.json must configure a GitHub MCP server that needs an access token, and the file is committed to the repository. What is the correct approach?
- A.Keep the whole server entry out of version control so each developer defines it personally.
- B.Store the token in the project CLAUDE.md so the agent can read it and pass it on each call.
- C.Reference the token as ${GITHUB_TOKEN} in the committed file and let each machine supply it.✓ Answer
- D.Commit the token in the file and rely on the private repository's access controls to protect it.
Environment variable expansion lets the committed configuration describe which credential is needed without ever containing its value, so the shared entry stays in version control while each machine supplies its own secret. Committing the literal token puts a live credential in history regardless of repository visibility, keeping the entry out of the repo defeats the point of sharing it, and CLAUDE.md is loaded context rather than a secret store.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.4 (environment variable expansion in .mcp.json)Report a problem with this question
19. An analytics agent connected to a database MCP server spends many calls discovering which tables and columns exist before it can answer anything. Which addition to the server best removes that exploration?
- A.A resource that publishes the database schema, so the agent sees what data exists without extra calls.✓ Answer
- B.A prompt template telling the agent to guess table names and verify each with a query.
- C.A tool named list_tables that the agent calls first, returning that catalog once per session.
- D.A second server for schema lookups so exploration never competes with query traffic.
MCP separates tools, which are executable actions, from resources, which are contextual data and content catalogues the client can surface without invoking anything. Publishing the schema as a resource lets the agent see what data exists as context rather than paying tool calls to find out, while a list_tables tool still spends a call, a prompt template only formalises guessing, and a second server adds infrastructure without changing the discovery cost.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.4 (MCP primitives: tools, resources, prompts)Report a problem with this question
20. You are designing an MCP server that gives a code-generation agent access to an internal filesystem. Which design best matches the recommended security posture?
- A.Expose an allowlist of permitted directories and treat returned file content as untrusted.✓ Answer
- B.Expose the whole filesystem read-only, since a read-only server cannot modify anything at all.
- C.Expose the repository root and block a denylist of sensitive paths such as .env and secrets.
- D.Expose full read access and rely on the system prompt to keep the agent out of certain files.
Least privilege means a server exposes only what the task requires, and an allowlist fails closed while a denylist silently permits every path nobody thought to list, including new ones added later. Tool results are also data produced outside your control, so file content must be treated as untrusted input rather than as instructions, and read-only access still leaks secrets it can read.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.4 (least privilege and allowlisting); MCP security guidance on untrusted tool outputReport a problem with this question
21. An agent must find every call site of a function named validateSession across an unfamiliar repository. Which built-in tool fits, and why?
- A.Read, which loads a file's full contents so the agent can scan each one for the name.
- B.Glob, which matches file paths against a pattern and returns the files whose names fit it.
- C.Bash, which runs a shell command whose output the agent then parses for matching lines.
- D.Grep, which searches file contents for a pattern and reports the files and lines that match it.✓ Answer
Grep and Glob divide along contents versus paths: a call site is text inside a file, so it is found by searching contents, whereas Glob only answers which files have names matching a pattern. Reading every file to scan it does not scale on an unfamiliar repository, and shelling out duplicates a built-in that already returns structured file and line matches.
Source: Anthropic CCA Foundations Exam Guide v1.0, Domain 2, Task 2.5 (Grep searches contents, Glob matches paths)Report a problem with this question
Practice questions based on the official Claude Certified Architect – Foundations (CCAR-F) exam guide and Anthropic's public documentation. This is an independent study tool, not affiliated with or endorsed by Anthropic, and does not grant certification. It is delivered via Pearson VUE; Anthropic publishes the current question count, time limit, passing score and fee in the official CCAR-F exam guide. Official certification page →