Hypothetical scenario. Northwind’s analyst investigates a possible support-volume change. Maya wants an explanation and a useful chart. Dev proposes a restricted aggregate query; Priya asks what the numbers can establish and what a correction attempt may change.
Maya: “A larger count tells us what changed, but not why.”
Dev: “We can query the approved view and check the grouping before plotting it.”
Priya: “Keep the query inside its scope even if an error suggests an easier route.”
You will combine a restricted SQL operation, bounded correction and checked visualization. Trace the supplied count arithmetic while distinguishing an observed difference from a statistically supported anomaly or causal explanation.
What can the bounded analyst legitimately conclude?
Hypothetical scenario. Northwind permits a read-only aggregate over an approved support view for one tenant and a bounded time interval. The agent selects that operation, not arbitrary database text with privileged credentials. The runtime checks the query shape or approved template, binds tenant scope outside the model and enforces time, row and resource limits. Reject writes and unapproved relations before execution; a database error is an observation, not permission to broaden scope.
Choose daily counts of 10, 12, 11 and 23. The baseline mean for the first three days is (10 + 12 + 11)/3 = 33/3 = 11. The fourth day exceeds it by 23 − 11 = 12, about 12/11 × 100 = 109.1%. This is an invented descriptive comparison, not a statistical anomaly detector or proof of cause. Preserve timestamps, grouping and missing-day rules before choosing a chart.
For a correction exercise, let the first query fail because it names a nonexistent column. The agent may inspect the approved schema and retry once within the same read-only contract. If the second attempt fails, return an incomplete outcome rather than granting schema-wide exploration. For visualization, choose a time-ordered count chart with its baseline labeled; never display the percentage as a confidence level. Completion requires the checked aggregate, a bounded interpretation and an explained chart choice.
Two tools look alike until one changes the account
Northwind exposes one tool that reads the status of a supplier document and another that publishes a revised document. Their names share the words “document” and “update.” Priya asks whether a correction is ready. The assistant chooses the publishing tool because its description mentions the final approved version. The selection problem has crossed into a consequential action.
The interface should let the model distinguish intent before it constructs arguments. Give each tool an explicit purpose, required inputs, observable result and relevant exclusions. A read tool can describe the state it observes. A publishing tool should identify its effect and the evidence required before invocation. The application still validates those requirements at execution time.
Constrain the analyst at query and interpretation boundaries
Hypothetical scenario. The SQL analyst proposes a query, validates its permitted structure and executes with read-only scoped credentials and resource limits. The resulting rows carry dataset snapshot, query identity, units and missing-value policy into interpretation and visualization.
| Artifact | Concrete evidence | Decision boundary |
|---|---|---|
| Query proposal | SQL, parameters, intended measure | Semantic review |
| Execution grant | read-only scope, timeout, row/work limits | Database boundary |
| Result artifact | snapshot, units, grouping, provenance | Bounded interpretation |
A corrected query must pass the same checks as the first proposal. Reject unrestricted statements and unbounded work at the actual database boundary; a model instruction to be careful is insufficient. A larger count is a descriptive observation unless an appropriate comparison establishes more. Preserve grouping and time windows in chart labels so a visualization cannot imply a causal conclusion the data does not support.
Why descriptive warnings cannot enforce a boundary
A sentence saying “only call after approval” provides useful context to a model, but it is not an approval check. A generated request can ignore the sentence, misunderstand the task or use stale state. An attacker-controlled document can also contain language that resembles an instruction. The tool service must enforce its actual identity, permission and revision contract.
Separate selection quality from execution correctness in the design record. A model can select the correct tool but supply a malformed identifier. It can produce syntactically valid arguments for an unauthorized target. It can even receive an authorized response while failing the user's intended task. These outcomes need different tests and different recovery paths.
What a tool contract communicates
The Model Context Protocol tools specification defines tool discovery and invocation structures, including a tool's name, description and input schema. These elements provide an interface a client can expose to a model. They do not establish the business permission to perform every representable request.
Write descriptions around distinctions the caller must make. “Retrieve the current status for a document identity” is more discriminating than “help with documents.” For a publishing operation, make its side effect and required proposal identity clear. Avoid describing both tools as universal assistants; that removes the contrast the selector needs.
An input schema can constrain the shape of a request. It can express that a field is required or has a selected type. The application then checks whether the referenced document exists, whether the actor may access it, whether the proposal matches its approved revision and whether the current state permits publishing. Structural validity is an early boundary, not the complete task contract.
Keep the three decisions visible
Follow the decision boundaries
The first stage proposes a tool. The second validates arguments and target identity. The third enforces permission and action preconditions. A rejection at one stage should carry a useful reason to the workflow without leaking information the actor is not allowed to see. Recovery can ask for clarification, choose a read-only alternative or stop.
Measure selection with explicit denominators
Hypothetical scenario. Construct a test set with 100 requests. Forty require the status tool, thirty require publishing after a valid approval, and thirty require no tool at all. These are selected categories, not observed traffic. The expected tool decision is labeled before comparing description variants.
Suppose a candidate description produces 35 correct status choices, 24 correct publish choices and 25 correct abstentions. Correct decisions total 35 + 24 + 25 = 84. Overall selection accuracy is 84 / 100 = 84%. That number hides which mistakes are most consequential, so preserve the confusion matrix rather than reporting only the aggregate.
Assume the selector proposes publishing 32 times, of which 24 are correct under the test labels. Publish-choice precision is 24 / 32 = 75%. Publish-choice recall is 24 / 30 = 80%. The eight incorrect publish proposals still require execution-time rejection. A higher overall accuracy does not make those eight proposals acceptable.
Now suppose authorization rejects all eight invalid publish proposals and two of the 24 correctly selected ones because their approval has expired by execution time. There are 24 − 2 = 22 potentially executable publish requests. The selection labels and current execution checks are describing different moments. Keep both records instead of treating every authorization rejection as a selector error.
Change the description without changing the test
Compare two description variants on the same labeled tasks, tool set and model configuration. Include ambiguous language, similar document names, explicitly read-only questions and requests with no sufficient authority. Record abstentions and unnecessary calls as well as correct tool choices. A description that improves ordinary examples but increases mistaken writes needs a trade-off review.
Tool order and the surrounding prompt can affect a selection experiment. Hold them fixed when isolating a description change, or explicitly test the combination you intend to ship. When several elements change together, the comparison can still guide a release decision, but it cannot attribute the difference solely to wording.
Inspect errors by meaning rather than only by spelling. If users ask whether a document is ready and the model repeatedly publishes it, the problem may be a missing status concept or an ambiguous action boundary. Renaming the publishing tool is one candidate intervention. Adding a well-defined read operation or clarifying the user-facing workflow may better address the gap.
In the wild: discovery metadata meets a real protocol
MCP's published tools interface provides a concrete example of descriptions and schemas crossing an application boundary. It makes tool metadata inspectable and gives invocation a structured form. Its existence supports evaluating an interface contract separately from model behavior; it does not certify that a tool's description is honest or that its implementation enforces Northwind's policy.
The paired Northwind tools are hypothetical. Their failure illustrates why capability discovery should not become capability delegation by accident. The server implementing a consequential operation remains responsible for checking the actor and target at the relevant boundary.
A tool result can change the next selection
Results are observations, not automatically instructions. A retrieved document might include text telling the assistant to call a different tool. A search result might advertise a tool name that resembles a trusted one. Keep the source of that text distinct from the application's control instructions, and validate the next proposed call under the same policy as any other call.
For a workflow that can discover tools dynamically, record the tool identity and version used for the decision. A familiar name does not prove that a newly discovered endpoint has the same behavior. The application needs a trust and onboarding policy before it exposes newly available actions to the model.
Minimize the information returned on denied requests. A rejected lookup can reveal a document's existence or title if its error message is too specific. The right response depends on the actor's scope, but the denial path deserves the same disclosure review as successful output.
More tools create an interface-design problem
A large catalog can contain overlapping operations, inconsistent vocabulary and several levels of abstraction. Group tools by meaningful task boundaries rather than assuming a model will infer an undocumented taxonomy. A narrow tool that reads one approved record can be easier to evaluate than a general tool that interprets arbitrary commands.
There is a trade-off between a small catalog of broad tools and a large catalog of specific ones. Broad tools move more interpretation into the service; narrow tools move more selection into the caller. Evaluate the complete task, including argument validity, permission enforcement and understandable failure messages. Catalog size alone is not a quality score.
Misleading conclusions from a tool demonstration
The model selected the tool, so the user requested its effect. Selection is a proposal. Establish the user's task and the permitted action separately.
A schema-valid call is safe. Structural validity leaves target identity, business rules and authority unresolved.
Removing write tools solves every disclosure risk. Read operations can disclose confidential information. Scope and output filtering still matter.
Give abstention a useful interface
Some requests do not identify a sufficient target or a permitted operation. The selector should be able to return a request for clarification or a supported no-tool result. Forcing every input to choose a tool can convert ordinary uncertainty into unnecessary access or action proposals.
A useful clarification asks for information that can change the decision. If two documents share a display name, request a stable identity or an appropriate disambiguating attribute. Asking the user to repeat an entire question without explaining the ambiguity is less helpful. Preserve the clarification as part of the task so that the next message continues the same decision rather than creating an unrelated operation.
Distinguish absent capability from denied authority. The application may lack a tool for the requested effect, or it may have the tool but disallow the current actor's use. These outcomes can require different user-facing explanations, while both should avoid exposing confidential catalog or target details.
Include no-tool cases in a release comparison. Measure whether an abstention prevents an unjustified action and whether it blocks a task that could have completed with a known safe read. The trade-off belongs to the application contract. A tool-call rate is an activity measure, not proof that an assistant is more useful.
What this interface analysis does not establish
The test uses selected labels and category counts; a production catalog can have different ambiguities and traffic. Description experiments are conditional on the model, prompt and tools evaluated. MCP metadata supplies an interface rather than a universal security policy. Network trust, tool implementation quality, authorization, business preconditions and response handling must be examined alongside selection performance.
Test the query proposal boundary
A repaired query returns the expected total but scans unrestricted tenant data. Is it acceptable?
Reveal the design reasoning
No. Correct output does not establish permitted execution. Enforce tenant scope and resource limits, then re-evaluate the result and its interpretation.
Decision: Keep query permission, execution cost and analytical support distinct.
Locate the failing boundary
A model selects the status tool but supplies a nonexistent identifier. Which metric should record the problem?
Selection can be correct while argument or identity validation fails. Preserve separate outcomes so the next intervention targets the right boundary. Treating both as the same error can hide an identifier-extraction problem behind tool-description edits.
Why does 84% overall accuracy not settle whether publishing is acceptable?
The aggregate mixes three categories. Publish proposals have 75% precision in the chosen example, leaving eight incorrect proposals. The execution boundary must reject them, and evaluation should consider their consequences separately from harmless abstention mistakes.
A document says the user has approved publication. Is that sufficient approval evidence?
Not merely because the model read it. Validate an approval record through the application's trusted mechanism, bound to the actor, proposal and current operation. A retrieved statement is content with a source, not automatic authority.
Northwind decision log
- Describe tools by the distinct decisions and effects they support.
- Measure selection, arguments and execution eligibility separately.
- Treat tool output as sourced observations rather than new authority.
Go deeper: supporting mechanisms
- Video lecture: Tips for building AI agents, Anthropic. Separate protocol structure from enforced access decisions.
- Book chapter: Security Engineering, third edition, chapter 4: Protocols, Ross Anderson. Separate protocol structure from enforced access decisions.
- Book chapter: Security Engineering, third edition, chapter 6: Access Control, Ross Anderson. Separate protocol structure from enforced access decisions.
- Primary document: Tool selection contracts authority reference. Inspect tool metadata and invocation separately from business permission checks.
Related: Agentic systems · Retries and tool outcomes.
Check the mechanism in this lesson
Does a 109.1% increase over the chosen three-day mean establish an anomalous event's cause?
Compare the explanation
No. It is a descriptive comparison on invented counts. Check grouping, missing data and a suitable statistical test before calling it an anomaly; causal explanation requires additional evidence.
Carry the decision forward
Northwind can inspect one analyst’s proposals and evidence. Page 26 asks whether specialist agents improve the task enough to justify additional artifacts, handoffs and coordination.