Skip to content
James Ross
articlePublished Updated 8 min read

Designing MCP tools that models call correctly

By James Ross

MCP tool design is API design for a caller that reads prose, retries on failure and has no memory of yesterday's call. The shape that works is a verb-first name, a flat argument object, a dry run by default for anything that costs, a human confirmation gate before irreversible work, and an error message that says what to change.

A neat rack of distinct instruments with a robotic arm selecting one and tidy result trays, illustrating MCP tool design.

The transport and authorization layers are covered in building a remote MCP server with OAuth 2.1. This post is about the part a model actually sees: the tool list and the result.

Name the verb and the object

A tool name is the model’s only index. It sees the name before it reads the description, and it sees every name at once. create_segment tells it what will happen; segment_tool and manage_audience do not.

Weak name Better name Why
segment create_segment Names the operation, not the noun
audience_tool describe_audience Says what comes back
process_import import_contacts Avoids an empty verb
get_data get_results Names the thing returned

Three naming rules do most of the work. Start with the verb, because a model scanning a list is looking for an action it can take. Keep one operation per tool, because a tool that creates, updates and publishes depending on arguments forces the model to encode a workflow in a parameter. And never put a version number in the name; the MCP endpoint is the version, and create_segment_v2 only teaches the model to guess.

Names also matter when a client aggregates servers. The specification notes that two servers can each expose a search tool, and clients may prefix names to disambiguate. A distinctive name is cheaper than someone else’s prefix.

Argument shapes models get right

A model fills an argument object from a schema and a description. The schema decides what it can get wrong; the description decides whether it understands the units.

  • Flat objects beat nested ones. A single level of properties is easier to fill correctly than a nested tree with a polymorphic branch.
  • Enums beat free strings. "weekly" | "daily" is checkable; "how often?" invites "every week" and a validation error.
  • IDs beat names. A name invites a lookup and a near-match. If the caller must resolve a name, expose a lookup tool and make the ID the argument.
  • Dates in RFC 3339 with a timezone. RFC 3339 is unambiguous; "next Tuesday" is not, and neither is a bare date when the server runs in UTC and the user does not.
  • Units in the name. timeout_ms, limit, duration_seconds. A bare timeout will eventually be sent in seconds to a field that expects milliseconds.

One anti-pattern looks helpful: a confirm or dry_run boolean that defaults to false on a tool that spends money. A model will call the tool to find out what it does. The safe default has to be the one a curious caller gets.

Dry run by default for anything that costs

The default for a costly tool should be a dry run. The email-marketing SaaS makes that literal: every tool that can spend credits takes confirm: true, and without it the call returns the cost and a description of what would happen, and changes nothing. The shape, with illustrative values:

{
  "dry_run": true,
  "credits": 12,
  "would": {
    "segments_created": 1,
    "profiles_matched": 1840,
    "approval_required": false
  }
}

The shape answers “how much” before the caller commits, says what would change in terms a person can check, and gives the model a cheap way to learn the tool without side effects.

The rank tracker uses the same pattern on its write tools: check_rank and run_check return the credit cost and require confirm: true, and the API has a separate ?dry_run=true that returns { would_hold, balance_after, allowed, reason }. The dry run is not a documentation page; it is the same validation and the same cost calculation with the write skipped.

The cost calculation must be server-side. A model that estimates its own cost will be wrong, and a client computing it from a documented formula will drift. Return the number from the code that will do the work.

Three effect tiers

Not every tool needs the same gate. Three tiers make the confirmation rule obvious to the caller and the reviewer.

Tier What it does Gate Examples
Read Reads account data, spends nothing Scope check only get_results, list_projects
Draft Creates an object that is not live None, but the object is inert until published create_segment, create_campaign
Commit Sends, publishes, spends or approves Human approval, not a model flag request_approval, live flow changes

Which should you choose? Put every tool in the earliest tier that still does the job. A draft tool that creates an inert object is better than a commit tool with a confirmation flag, because the flag is a promise the model makes about itself. The human approval step belongs in the product, where a person can see the snapshot, not in the tool’s argument list.

request_approval is the pattern: it creates a pending approval with a snapshot, and a human approves it in the app or by emailed link. The model can ask; it cannot consent.

Error messages written for a model

The MCP specification separates protocol errors from tool execution errors. An unknown tool or a malformed request is a JSON-RPC error, and a model can do little with it. A bad date, a failed API call or a business rule violation is a tool result with isError: true, because those are the errors a model can fix.

That distinction is the difference between a retry that works and one that repeats the call. A useful error names the field, the value, the constraint and the next step:

{
  "isError": true,
  "content": [{
    "type": "text",
    "text": "Invalid departure date: 2025-08-01 is in the past. Today is 2025-08-08. Use an ISO 8601 date on or after today."
  }]
}

Four rules make error text usable:

  • Name the field and the value. “Invalid input” makes the model guess; “location_code 2840 is not a supported location” does not.
  • State the constraint. “Must be one of desktop, mobile” is actionable; “validation failed” is not.
  • Include the current value when time matters. A date error without today’s date produces a second wrong guess.
  • Keep the code separate from the sentence. A code field lets the client branch; the sentence lets the model recover.

Never return a stack trace, an internal URL or a database error. Those are not only a leak; they are noise that a model will quote back to a user as if it were an explanation.

Report what happened, not what you intended

The most expensive tool bug is not a crash. It is a success response for work that did not happen, because the caller has no reason to retry and files the wrong result.

A Flow automation MCP server produced a clean example. A four-take video generation returned status: "success" with credits_consumed: true after 51 seconds, while the debug screenshot showed all four tiles at 32%. The takes need about four minutes each. The three files returned were the reference stills — JPEGs at the references’ own dimensions, two byte-identical — filed under outputs/videos/. Two debug screenshots, one named download-error.png, were written one second before the job declared success.

Nothing raised. The generation was fine: downloading by tile index afterwards pulled four distinct MP4s. The tool counted tiles at 32% as finished and reported the count it requested rather than the count it had.

The fixes are general:

  • Gate completion on the finished signal, not the presence of a tile. A tile at 32% is present and not done; the readiness signal must be the one the UI shows when the render finishes.
  • Refuse a candidate whose type does not match. A JPEG is not a video, and a file named after an input reference is not a generated take.
  • Read the result back from disk. A write that resolves is not a write that happened.
  • Report produced, refused and not-ready as separate counts. “3 of 4” with one reason is a decision; three reasons behind one DOWNLOAD_FAILED string is not.

That last point showed up in normal use: batches yielded two or three usable takes out of four, and the caller could not tell a reference still from a rendering tile from a genuinely short batch.

One deadline, not three

A single call can have three clocks on it: the server’s job timeout, the generation timeout and the client’s tool timeout. When they disagree, the shortest wins and it is usually the undocumented one.

The Flow server had a 300-second job timeout, a 600-second generation timeout and a 120-second client timeout, against a measured 3 minute 47 second render for one 8-second clip. The job timeout could fire from inside getStatus(), so the status tool could declare dead a job that was still rendering.

The shape that works is one deadline owned by the server, plus an asynchronous job:

  1. The tool validates the request and returns { status: "running", jobId } immediately.
  2. The job has one timeout, set where the work runs.
  3. A status tool reports progress and cannot kill the job.
  4. A completion tool returns the result, or a failure with a reason.

This is also the only shape that works for a hosted server. A four-minute blocking call holds a connection and a worker; an asynchronous job holds a row.

What broke and what we changed

Beyond the false success, three findings from the same server are worth recording because each is a design lesson.

  • Duplicate downloads inflated the sample. One batch returned two tiles under four names, with byte-identical pairs. A caller counting files overstated its sample. Dedupe by content hash before returning files[], or return a stable tile ID with each file.
  • A staging call was the best diagnostic in the server. Running with auto_confirm: false returned a screenshot and per-setting _applied flags, which caught a reference-attachment failure before any credits were spent. A dry run should show resolved state, not just say “ready”.
  • The monitoring tool killed what it monitored. A timeout check inside the status call turned a slow render into a failed one. Moving the timeout into the job, and making status read-only, removed the class.

Every failure was a reporting failure before it was a processing failure. The work usually happened; the tool described it wrongly.

Frequently asked questions

What makes a good MCP tool name?

A verb followed by the object, in snake case: create_segment, get_results, request_approval. Keep it under 128 characters, use only letters, digits, underscore, hyphen and dot, and make it unique within the server. Avoid vague verbs like process or handle and never put a version number in the name.

Should MCP tools default to dry run?

Yes, for any tool that spends money, sends a message or changes live behaviour. A model will call a tool to learn what it does, so the default call must be safe. Return the cost and a description of the effect, and require an explicit confirm: true to proceed.

How should an MCP tool report an error?

Use a tool result with isError: true for errors the model can fix, and a JSON-RPC error only for protocol failures such as an unknown tool. Put the field, the bad value, the constraint and the next step in the text, and keep a machine-readable code alongside it.

Why is a false success worse than an error?

Because an error produces a retry and a false success produces a wrong result that gets used. A caller who is told the video was generated will file the reference still as the day's take. It is better for the tool to fail loudly than to return something plausible and unverified.

Do MCP tools need output schemas?

Not required, but useful when the result has a stable shape. An output schema lets a client validate the result and shows the model which fields to expect, which reduces invented field names in follow-up calls. For free-form text results, a clear description is enough.

How do you test a tool that calls a paid API?

Mock the HTTP endpoint for the unit tests, and run the real call only after the free diagnostic confirms the configuration. Then assert on the failure paths as carefully as the success path: a refused request, a timeout and a partial batch are the cases that produce false success.