Anthropic

Code execution with MCP: Building more efficient agents

Anthropic's November 2025 article describes presenting MCP tools as code interfaces and processing intermediate data in an execution environment.

Anthropic||2 min read
Open original

At a glance

Source
Anthropic
Published
Nov 4, 2025
Read time
2 min read
Primary lane
MCP
MCPEngineering

Quick read

3 bullets
  • Anthropic's November 2025 article describes presenting MCP tools as code interfaces and processing intermediate data in an execution environment.
  • The approach can keep large intermediate results out of the model's context while returning a smaller result for reasoning.
  • The source's efficiency examples describe particular workflows. They are not measurements of this site's software or a guarantee for another agent.

Source briefing

✦

About this briefing

AI-assisted source summary and editorial analysis; not an independent test or endorsement. Verify claims in the original publication. How our briefings are produced.

Editorial analysis: specify the result contract

A smaller response is useful only if it preserves the information required by the task. Before changing a workflow, write down the fields that the final answer must contain and how a reviewer can verify each field. Treat omitted exceptions as errors, even when the resulting summary looks clean.

For a fictional stockroom, suppose a tool returns item identifier, quantity and storage location. A request asks which locations contain items below a reorder threshold. Test duplicate item identifiers across locations, a quantity of zero, a missing quantity and a failed page of results. The aggregation should preserve location and flag missing data; silently treating missing quantity as zero changes the meaning of the answer. This example is a proposed fixture, not an experiment run against an MCP service.

Keep a reference result from a straightforward implementation and compare records, not only the written summary. Log which pages were retrieved and whether an operation completed. If a multi-step process is interrupted, decide whether retrying repeats a write. Use a read-only fixture first so the experiment can be repeated without changing real records.

Decision rule

Measure end-to-end completion, error handling, cost and review effort together. Reducing context does not prove that permissions are correct or that a filtered result is complete. Record the environment and task definition alongside any numbers so another reader can distinguish a reproducible comparison from an illustrative claim.

Read the original publication for its implementation examples. This page is an attributed summary with an editorial test plan; it replaces an earlier imported copy of the source text.

Follow new source-reviewed articles

Follow the feed, share the briefing, or jump back into the archive.