Skip to content

CCDV-F · Domain 8: Tools and MCP · 10% of the exam

Task 8.1: Tool Design and Response Shaping

Building a tool for an integration: its input schema, a description that leads to correct calls, a small and actionable result, error handling, client or server execution, an approval step, and a tool set that performs well together.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.

Question 1 · choose 1

You add strict: true to a tool whose schema checks invoice numbers such as INV-204511:"invoice_id": { "type": "string", "pattern": "\\bINV-\\d{6}\\b", "description": "Invoice number, for example INV-204511" }Requests with the tool now fail with a 400 error before Claude answers. What should you change?

  1. ARemove strict, since strict tool use does not accept a pattern on any string property
  2. BMove the pattern into input_examples so that the rule is shown instead of compiled
  3. CReplace \d with [0-9], since character class shorthands are not supported in strict schemas
  4. DRewrite the pattern without word boundaries, for example as ^INV-[0-9]{6}$
Show the answer and why
  • ARemove strict, since strict tool use does not accept a pattern on any string property

    Incorrect

    Strict schemas support simple regex patterns; only some regex features are not supported.

  • BMove the pattern into input_examples so that the rule is shown instead of compiled

    Incorrect

    Examples illustrate inputs; they do not replace a pattern, and the schema itself is what fails.

  • CReplace \d with [0-9], since character class shorthands are not supported in strict schemas

    Incorrect

    \d is a supported character class; the word boundaries are what the grammar cannot compile.

  • DRewrite the pattern without word boundaries, for example as ^INV-[0-9]{6}$

    Correct

    Word boundaries such as \b are not supported in strict schemas; anchors and simple quantifiers are.

Strict tool use compiles the schema into a grammar. Simple regex works, including anchors, simple quantifiers and classes such as \d, but backreferences, lookarounds and word boundaries (\b, \B) are not supported, and a strict tool's pattern using one fails with a 400 error.

Question 2 · choose 1

Your evaluation runs track metrics for each tool. They show that in a typical task the agent calls list_orders eight to ten times in a row, each call returning the default 10 orders, before it has the 80 orders it needs. Invalid-parameter errors are rare. According to Anthropic's guidance on writing tools, what do these metrics suggest?

  1. ARewrite the tool's description, since frequent calls show Claude misunderstands what it does
  2. BRightsize the pagination defaults so that one call returns what a typical task needs
  3. CSplit list_orders into one tool per order status so that each call returns fewer orders
  4. DReturn every order the customer has ever placed in one response, with no paging
Show the answer and why
  • ARewrite the tool's description, since frequent calls show Claude misunderstands what it does

    Incorrect

    Description and example problems show up as invalid-parameter errors, which are rare here.

  • BRightsize the pagination defaults so that one call returns what a typical task needs

    Correct

    Lots of redundant calls suggest rightsizing pagination or token limit parameters.

  • CSplit list_orders into one tool per order status so that each call returns fewer orders

    Incorrect

    Narrower tools would add calls, while the metric already points to too many round trips.

  • DReturn every order the customer has ever placed in one response, with no paging

    Incorrect

    Responses that could use lots of context should keep pagination, filtering or truncation with sensible defaults.

Tool-calling metrics point to fixes: many redundant calls suggest rightsizing pagination or token limit parameters, and many invalid- parameter errors suggest clearer descriptions or examples. Keep paging, filtering or truncation with sensible defaults for large responses.

Question 3 · choose 1

In the TypeScript Claude Agent SDK, you set a custom tool's permission_policy to always_ask. A teammate adds the tool's name to allowedTools so that it runs without approval. What happens?

  1. AThe allowedTools entry wins, and the tool runs without asking
  2. BThe tool is removed from Claude's context
  3. CCalls still need approval, because no allow rule approves an always_ask tool
  4. DThe SDK rejects the configuration at startup
Show the answer and why
  • AThe allowedTools entry wins, and the tool runs without asking

    Incorrect

    No allow rule approves calls to an always_ask tool.

  • BThe tool is removed from Claude's context

    Incorrect

    always_ask governs approval, not whether the tool is available.

  • CCalls still need approval, because no allow rule approves an always_ask tool

    Correct

    Not even an allowedTools entry approves its calls.

  • DThe SDK rejects the configuration at startup

    Incorrect

    The configuration is accepted; the allow rule simply doesn't apply.

In the TypeScript SDK, a custom tool whose permission_policy is always_ask is approved by no allow rule, not even an allowedTools entry. Its calls still go through approval.

Question 4 · choose 1

Your agent runs shell commands through a run_shell tool you defined yourself. A colleague suggests using Anthropic's bash tool instead, which your application would still execute. What reason does the documentation give for that choice?

  1. AIts schema is trained-in, so Claude calls it more reliably than an equivalent you define
  2. BAnthropic runs the commands on its own servers, so your code does no execution of its own
  3. CIt needs no tool_result, because the response already contains the command output
  4. DIt removes the need to send a tools array in the request
Show the answer and why
  • AIts schema is trained-in, so Claude calls it more reliably than an equivalent you define

    Correct

    Claude has been optimized on many trajectories that use these exact tool signatures.

  • BAnthropic runs the commands on its own servers, so your code does no execution of its own

    Incorrect

    Anthropic-schema tools are client-executed: your application runs them.

  • CIt needs no tool_result, because the response already contains the command output

    Incorrect

    The execution model is the same as your own tools, with a tool_result.

  • DIt removes the need to send a tools array in the request

    Incorrect

    The tool is still declared in the request's tools.

For common operations such as running shell commands or editing files, Anthropic publishes the tool schema and your application handles execution. The schemas are trained-in, so Claude calls them more reliably than an equivalent tool you define yourself.

Practice domain 8 →Practice all domains →