{"id":3663,"date":"2026-10-12T06:59:25","date_gmt":"2026-10-12T06:59:25","guid":{"rendered":"https:\/\/www.exam-topics.net\/blog\/?p=3663"},"modified":"2026-10-12T20:35:51","modified_gmt":"2026-10-12T20:35:51","slug":"claude-mcp-tool-contracts-errors-permissions","status":"publish","type":"post","link":"https:\/\/www.exam-topics.net\/blog\/claude-mcp-tool-contracts-errors-permissions\/","title":{"rendered":"Anthropic CCA-F: Claude MCP Tool Contracts, Errors and Permissions"},"content":{"rendered":"<p>A Model Context Protocol connection makes an external capability discoverable. It does not make that capability safe, accurate or authorized. For a Claude architect, those are separate obligations: decide which operations belong in the integration, describe them clearly enough for the model to choose correctly, and place actual authentication, business rules and failure handling in the service that executes them.<\/p>\n<p>Tool Design &amp; MCP Integration represents 18% of the published <a href=\"https:\/\/www.exam-topics.net\/cca-f\">Claude Certified Architect \u2013 Foundations<\/a> blueprint. A sound approach to this domain begins with an API design review rather than memorizing MCP vocabulary. The useful question is not whether a tool can be called, but whether a model-directed system can call it safely, interpret the result and recover from a bad one.<\/p>\n<h2>Start with the business capability, not a database table<\/h2>\n<p>Suppose a procurement assistant needs to check a supplier&#8217;s approved payment terms before drafting an invoice exception request. A careless tool might expose `run_sql(query)` or a broad `get_supplier(id)` response containing banking details, private contacts and unrelated purchase history. Both make the integration easy to build and difficult to govern. The assistant does not need unrestricted SQL, and the model should not receive information outside the task.<\/p>\n<p>A better capability is something like <code>read_authorized_supplier_terms<\/code>. Its inputs identify the supplier and the current business context, while the server derives the requesting identity from the authenticated session rather than trusting a model-supplied user ID. The response returns the approved terms, a verification timestamp, a stable source reference and, when relevant, a reason the information cannot be released. The application can then decide whether a draft exception is justified without exposing a financial account number.<\/p>\n<p>Tools should be shaped around actions a legitimate user actually needs: locate a policy revision, retrieve a permitted order summary, prepare\u2014but not commit\u2014a change request. This makes tool selection easier to explain and reduces the effect of a mistaken model choice. If changing supplier payment terms would be consequential, split proposing from committing and put the latter behind a separate, enforced authorization path.<\/p>\n<h2>Give tool descriptions enough discrimination to be useful<\/h2>\n<p>Consider two similar tools, one for current policy and one for historical policy revisions. If both are described as \u201cretrieve policy,\u201d Claude has little basis for choosing safely. The descriptions should state the intended decision, required input, source restrictions, and what the output means. Describe when the tool must <em>not<\/em> be used as carefully as when it should be used. A current-terms lookup must not pretend to answer a question about the supplier&#8217;s 2023 contract.<\/p>\n<p>Define a small, explicit input schema. An identifier should have a known shape; a requested period should be unambiguous; optional fields should not silently broaden access. Anthropic&#8217;s tool-use API lets developers express input requirements with JSON Schema, and strict tool mode can constrain calls to supported schema shapes. That reduces invalid parameters. It cannot replace a service-side check that the user has the right to see the requested record.<\/p>\n<p>Descriptions are part of the model-facing choice surface, not security policy. The server remains responsible for verifying the session, validating business rules, limiting access, rate-limiting operations and recording sufficient audit evidence. A malicious user cannot legitimately become an approver by typing an \u201capproved by CFO\u201d field into a prompt, even if the resulting tool arguments pass schema validation.<\/p>\n<h2>Understand the MCP boundary without confusing its elements<\/h2>\n<p>MCP commonly exposes different classes of capability. A <em>tool<\/em> represents a callable operation; a <em>resource<\/em> makes information available; a <em>prompt<\/em> can offer a reusable interaction template. Those concepts help organize an integration, but none should be used as a shortcut around access control. A resource URL can still point to sensitive material, and a prompt template can still include untrusted words that must not be promoted to system authority.<\/p>\n<p>Consider exposing a policy corpus. Read-only policy documents may be appropriate as resources that an authorized client can retrieve, while a narrowly scoped function handles the action of looking up a current effective policy. A separate approval operation belongs in an application that checks delegated authority. Putting all three into an undifferentiated \u201ccompany knowledge\u201d tool makes the system harder to test and easier to over-permission.<\/p>\n<p>An MCP server&#8217;s published capability list also needs lifecycle management. The installed server version, enabled tools, permissions and underlying provider API may change while the client&#8217;s prompt remains the same. Review permissions after deployment changes and test that a tool no longer needed by the workflow is not merely hidden from the prompt but remains inaccessible to the executing identity.<\/p>\n<h2>Design errors that a model cannot mistake for success<\/h2>\n<p>Suppose the supplier lookup returns an empty list. Is the supplier genuinely absent, is the caller unauthorized, or is the database unavailable? If the result says only \u201cno matches,\u201d Claude may reach the wrong business conclusion. A model can be excellent at reasoning over text and still be misled by an ambiguous service contract.<\/p>\n<p>A useful tool result contains a distinct state and structured details. Anthropic&#8217;s tool-result conventions support signaling execution errors with <code>is_error<\/code>; a tool-specific business payload can additionally indicate business states such as not found, forbidden or inconsistent data. Do not rely on an English sentence hidden in a long blob to communicate whether the operation failed.<\/p>\n<table>\n<caption>Four conditions that require different responses from a tool-using application.<\/caption>\n<thead>\n<tr>\n<th scope=\"col\">Condition<\/th>\n<th scope=\"col\">Safe system interpretation<\/th>\n<th scope=\"col\">Typical next step<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Not found, service healthy<\/td>\n<td>The requested record was not found under the permitted query<\/td>\n<td>Request a verified alternate identifier or report the absence<\/td>\n<\/tr>\n<tr>\n<td>Forbidden<\/td>\n<td>The operation was denied; this is not an empty result<\/td>\n<td>Stop that operation; use an authorized escalation route<\/td>\n<\/tr>\n<tr>\n<td>Timed out<\/td>\n<td>Completion status may be unknown<\/td>\n<td>Reconcile through a safe read; retry only if the operation is repeatable<\/td>\n<\/tr>\n<tr>\n<td>Malformed or contradictory result<\/td>\n<td>The evidence cannot yet support a business conclusion<\/td>\n<td>Validate source\/schema, quarantine the result or request review<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Do not build a recovery loop that responds to every error by rephrasing the request and trying again. Permission denials should not be treated as invitation to search for an alternate path to the same protected data. A rate limit may call for backoff. A validation error may call for corrected inputs. A possibly completed write may require checking the system of record using an operation identifier before anything is repeated.<\/p>\n<h2>Separate a tool call&#8217;s schema from the truth of its result<\/h2>\n<p>Input validation proves that the submitted tool parameters have the required form. Output validation proves that returned fields match a specified structure. Neither proves that a supplier identifier refers to the correct legal entity, that the policy version is current, or that the caller should have received the record. Architects should specify provenance and freshness alongside types, then build rules that act on those facts.<\/p>\n<p>For a supplier-terms response, useful fields include the record identifier, verified entity name, effective dates, source system, last-check timestamp, decision state and an explicit caveat if the status is unresolved. These fields should be generated by the service from authoritative records, not provided as model guesses. A deliberately missing field is often safer than filling it with an invented default. A response whose shape validates but whose source is outdated should still be rejected for the intended decision.<\/p>\n<p>This distinction is especially important when combining tool output with <a href=\"https:\/\/www.exam-topics.net\/blog\/claude-structured-output-prompt-validation-architectures\/\"><em>structured final output<\/em><\/a>. A final JSON object may say <code>approved: true<\/code> and conform perfectly to its schema while violating a payment policy. Only the business application, acting under a valid authorization rule, can actually approve the transaction. Treat the model&#8217;s field as an assessment or recommendation unless the operating contract explicitly assigns a different meaning.<\/p>\n<h2>Keep the tool surface limited and make tool choice observable<\/h2>\n<p>Tool proliferation creates a subtle form of unreliability. Give a model twenty overlapping functions named `search`, `lookup`, `get` and `fetch`, and it has to infer distinctions from descriptions that the developers themselves may not have agreed on. Prefer a coherent set of capabilities named for jobs, with examples that distinguish similar tools. Where a platform supports selecting or forcing a tool, use that control only when the workflow actually requires it, and test the resulting call behavior rather than assuming the model will always choose well.<\/p>\n<p>A mature integration logs tool selection, the request identifier, identity or permission context, execution status and appropriate source metadata. It should be possible to answer why a call happened and what would change if the same request were repeated. That is the basis for evaluation: give the workflow cases requiring no tool, one read-only tool, a denied tool and several conflicting sources, and see whether it chooses and interprets correctly.<\/p>\n<p>The <a href=\"https:\/\/www.exam-topics.net\/blog\/claude-ccdv-f-tools-agents-and-mcp\/\">Developer Foundations discussion of tools and MCP<\/a> takes the perspective of an engineer implementing the request\/response cycle. Here the architectural focus is which business capability is justified, who may execute it and which failure states the wider system can withstand.<\/p>\n<h2>Use a contract-review exercise before an MCP rollout<\/h2>\n<p>Take the supplier lookup and conduct a review as though another team will operate it for a year. Can a developer tell exactly what the tool reads? Is identity derived from a trusted context? Can the model call a write inadvertently? Does the output distinguish missing data from an outage? Is the source timestamp visible? Does a log contain enough information to diagnose a complaint without exposing unnecessary private details?<\/p>\n<p>Now introduce two failures: an MCP server sends a plausible result that contradicts the official supplier record, and a retrieved document tells Claude to execute a financial change. In the first case, reconcile to the system of record or surface the conflict. In the second, treat the embedded instruction as untrusted data. Neither is solved by making the prompt more forceful. The authorization boundary must operate independently of the model&#8217;s confidence.<\/p>\n<p>In a Foundations scenario, this reasoning usually leads to a narrower and more predictable design: fewer tools with better contracts; model discretion over information-gathering choices, not business authority; structured and observable errors; and explicit treatment of partial failure. The same design principles carry through to the broader <a href=\"https:\/\/www.exam-topics.net\/blog\/ccar-p-tool-use-and-mcp-integration\/\">Professional treatment of tool boundaries<\/a>, where multi-system enterprise governance adds further requirements. The core skill is to defend the trust contract before connecting one more service.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Architect safe Claude MCP integration contracts using scoped authorization, precise tool schemas, recoverable errors and evidence-aware execution.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-3663","post","type-post","status-publish","format-standard","hentry","category-anthropic"],"_links":{"self":[{"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/posts\/3663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/comments?post=3663"}],"version-history":[{"count":2,"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/posts\/3663\/revisions"}],"predecessor-version":[{"id":3905,"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/posts\/3663\/revisions\/3905"}],"wp:attachment":[{"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/media?parent=3663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/categories?post=3663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.exam-topics.net\/blog\/wp-json\/wp\/v2\/tags?post=3663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}