From Assistant to Agent: Tools, MCP and Evaluation

Anthropic sells AI models, yet its guide to building agents urges restraint: start simple, add complexity only when needed. That "might mean not building agentic systems at all."

Provisional

Guess first

Text in a web page can carry instructions that an AI agent reading it may follow. What is the most reliable safeguard?

Not set

· Committing first, even to a wrong guess, makes the answer stick.

At a glance · about 1 min

Four Stages of Autonomy

  1. Bounded agentThe model picks the next tool, inside hard limits.
  2. RetrievalThe model answers from documents you supply.
  3. Fixed workflowCode decides the steps; some steps call a model.
  4. Assisted codingYou write the spec and review every change.
Climb to the next stage only when an evaluation shows it beats something simpler.

In brief

Four stages lead from assisted coding to one bounded agent that picks its next tool inside hard limits. More autonomy means more ways to fail and more cost, not more skill. Climb only on evidence: an assistant that cannot beat, or usefully complement, keyword search has not earned its place.

Key ideas

  • More autonomy means more ways to fail and more cost, not more skill, so move up from simpler designs only when evaluation shows a benefit.
  • No complete defence against prompt injection is known, so rely on hard limits on capability, time, count, money and secrets to shrink the damage an injected instruction can do.
  • Measure before tuning: compare against a keyword-search baseline, use a fixed evaluation set with held-out cases, and count cost per useful result, treating unknown cost as unknown, never zero.
Check yourself 5 cards answer from memory, then open each

Retrieval, not rereading, makes learning last (see the weekly loop). Grade yourself honestly and the study dashboard brings each card back on a spaced schedule that supports retention.

  1. recall

    Name the four stages of the page's progression, and say what separates a workflow from an agent.

    Show answer

    The stages are assisted coding, deterministic workflow, retrieval, and one bounded agent. In a workflow the code decides what happens next; in an agent the model chooses which tool to call next, inside hard limits.

  2. recall

    In the Model Context Protocol, what is the difference between tools and resources?

    Show answer

    Tools are actions the model can request, such as querying a database, and they can have side effects. Resources are data the application can read, such as a file or record, and they provide context rather than action.

  3. explain

    Why does the page recommend that a first MCP server be local and read-only?

    Show answer

    It exposes data you own over stdio and can change nothing. If it misbehaves, the worst outcome is a wrong answer, not a deleted file, so the cost of failure stays small while you learn.

  4. apply

    You tuned your document assistant against all twenty of your test questions and it now scores 19 out of 20. What is wrong with trusting that score, and what should you do instead?

    Show answer

    Tuning on every case means the score measures memorisation of the test, not quality. Since all twenty have been tuned on, you need fresh cases: tune against one portion and keep the rest unseen as a held-out set. Twenty cases can also show gross failures but cannot support fine statistical claims.

  5. connect

    The first stage of this page's progression is assisted coding, covered in "Working with AI Coding Agents: A Disciplined Loop". What is your role at that stage, and how does it differ from the final stage?

    Show answer

    At assisted coding you write the spec and review every change yourself. At the final stage, one bounded agent, the model itself chooses which tool to call next, so trust has to come from hard limits written down in advance and from evaluation against a simpler baseline.

A four-stage path from assisted coding through a deterministic workflow and retrieval to one bounded tool-using agent, with evaluation against a non-AI baseline at every step.

After this page You can build a bounded agent in stages, climbing only when a fixed test shows it beats something simpler.

#agents#mcp#evaluation#ai

Read the full pageHide the full page · 6 min

It is easy to build an AI system that looks impressive in a demo and cannot be trusted in daily use. This page lays out a staged path from a coding assistant to one bounded agent that uses tools, with a measurement at each step that asks one question: is this better than something simpler?

The central claim is modest. More autonomy means more ways to fail and more cost; it does not mean more skill. Provisional, but supported by published design guidance (see below).

The progression

A learner can climb through four stages, and move up only when an evaluation shows a benefit.

  1. Assisted coding. You write the spec and review every change; see Working with Coding Agents.
  2. Deterministic workflow. A fixed sequence of steps, some of which call a model. The code decides what happens next.
  3. Retrieval. The model answers from documents you supply, rather than from memory alone. The idea was formalised as retrieval-augmented generation (Lewis et al., 2020). Established
  4. One bounded agent. A model that chooses which tool to call next, inside hard limits.

Anthropic's engineering guidance, Building effective agents (2024), draws the same line between workflows (paths defined by code) and agents (the model directs its own process), and recommends starting with the simplest solution and adding complexity only when it demonstrably helps. That is a design recommendation from a vendor with an interest in agents, and still it argues for restraint.

What MCP is

The Model Context Protocol (MCP) is an open specification for connecting an AI application to external capabilities. Its core ideas:

  • Tools: actions the model can request, such as "query this database". They can have side effects.
  • Resources: data the application can read, such as a file or a record. They are for context, not action.
  • Prompts: reusable templates a server offers.
  • Transport: a local server usually talks over standard input and output (stdio); remote servers use HTTP-based transport.

A sensible first server is local and read-only: it exposes data you own, over stdio, and can change nothing. If it misbehaves, the worst outcome is a wrong answer, not a deleted file. Check the current specification and SDK documentation for your language, since the protocol is still evolving.

Design limits come first

Before the agent does anything useful, write down what it can never do.

Limit Example
Capability boundary Read-only access; no network write; no shell
Time A timeout on every tool call
Count A maximum number of calls per question
Money A hard spend cap per run and per day
Secrets API keys held server-side, never passed to the model or the browser

Limits matter because of prompt injection: text the model reads (a web page, a document, a tool result) can contain instructions that it may follow. This is documented in the research literature (Greshake et al., 2023) and listed first in OWASP's top ten for LLM applications. The reliable defence is not a cleverer prompt but a smaller blast radius: an agent that cannot write, cannot spend without limit and cannot see secrets has little to abuse. Established as a risk; no complete technical defence is known, so treat the claim of safety as Provisional.

A source-grounded assistant

A useful first agent answers a bounded question from named sources, cites them, and abstains when the evidence is missing. Abstaining is the hard part, because a fluent model prefers to answer. Test for it directly.

Evaluation: the baseline and the set

Build the measurement before you tune anything.

The baseline. A plain keyword search over the same documents. If your assistant does not beat it, or at least usefully complement it, the extra machinery has not earned its place.

The evaluation set. A small, fixed list of questions with known right outcomes. A twenty-case set might contain:

Case type Count What it checks
Answerable 8 Correct answer with the right citation
Unanswerable 4 Says "insufficient evidence"
Stale or conflicting sources 4 Notices the conflict or the date
Tool failure 2 Fails safely when a tool times out or errors
Injection 2 Ignores instructions embedded in the source text

The count is an illustration, not a standard; twenty cases can show gross failures but cannot support fine statistical claims.

Development versus held-out. Tune against one portion and keep the rest unseen. If you tune on every case, your score measures memorisation of the test, not quality. This is the same discipline that Judgment Under Uncertainty asks of forecasts: commit before you look. A well-run trial commits the same way, naming its primary outcome in advance (CONSORT 2010). A blueberry trial (Curtis et al., 2019) missed its primary outcome, as Reading Nutrition Evidence explains. Its secondary wins do not erase that.

Cost per useful result

Record, for each run, the model, tokens, latency, status and the price basis you used, and keep estimated and billed cost separate. Two rules matter:

  • Unknown cost is not zero. If you lack a price for a run, leave it unknown; a zero silently understates the total.
  • Measure per useful result, not per call. A cheap system that is wrong half the time is expensive.

Re-importing the same records must not double count, so give each run a stable identity key. Arithmetic like this is only as good as its stated assumptions, as shown in Quantitative Reasoning. For a ledger this small, a single-file SQLite database is usually enough (SQLite's own guidance on appropriate uses discusses this).

Freshness is its own failure: a source that was true last year may not be true now, which is the subject of Stale Information and Dependable Reports.

When not to add things

Do not fine-tune a model, add a vector database, or introduce an orchestration framework until a measured failure requires it. Each is a legitimate tool, and each adds cost, moving parts and things to explain. A specific failing case on your evaluation set is the justification; enthusiasm is not.

Finally, write up what you built, what it scored, what it cost and where it fails, in the manner of Technical Writing as Reasoning. The wider question of what machines should and should not be trusted with is taken up in Technology, AI and Human Judgment.

Try this

  1. Write ten questions about a small set of documents you own: five answerable, two unanswerable, two where sources disagree, one containing a hidden instruction. Run a keyword search first and score it.
  2. Specify, in one paragraph, a read-only tool for your own data: its name, inputs, output, timeout, call limit and what it can never do. Do not build it until the paragraph is reviewed.
  3. Build a small cost table with three runs, one of which has no known price. Check that the total reports the unknown instead of treating it as zero.

Further reading

  • Schluntz and Zhang, Building effective agents (Anthropic, 2024).
  • Model Context Protocol documentation, modelcontextprotocol.io: concepts, transports and SDKs.
  • Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks" (NeurIPS 2020).
  • Greshake et al., "Not what you've signed up for" (2023), on indirect prompt injection.
  • OWASP, Top 10 for Large Language Model Applications.
  • Manning, Raghavan and Schutze, Introduction to Information Retrieval (2008), for keyword-search baselines and evaluation.

Sources 8
  • Schluntz, E. and Zhang, B. (2024). Building effective agents. Anthropic. anthropic.com/engineering/building-effective-agents.
  • Model Context Protocol specification and documentation. modelcontextprotocol.io (concepts: tools, resources, prompts; transports stdio and Streamable HTTP).
  • Lewis, P. et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. NeurIPS 2020.
  • Greshake, K. et al. (2023). Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. arXiv:2302.12173.
  • OWASP. Top 10 for Large Language Model Applications (LLM01 Prompt Injection).
  • SQLite documentation, 'Appropriate Uses For SQLite'. sqlite.org/whentouse.html.
  • Schulz, K. F., Altman, D. G. and Moher, D. (2010). CONSORT 2010 Statement: updated guidelines for reporting parallel group randomised trials. BMJ, 340, c332.
  • Curtis P. J. et al. (2019). Blueberries improve biomarkers of cardiometabolic function in participants with metabolic syndrome: results from a 6-month, double-blind, randomized controlled trial. American Journal of Clinical Nutrition, 109, 1535-1545.