Skip to navigation

Claude Code Tool Results: Return Evidence Instead of Opaque Status

In short: Make tool results useful to Claude Code by returning the requested evidence, a clear status, and enough context to interpret the result.

Published 18 min read
On this page

Direct answer

Return the evidence that caused the tool call, not only a success message. A useful result names the status, answers the requested question, includes the relevant source or location, and identifies missing data. Keep raw observations separate from interpretation.

Official Messages API documentation describes an application executing a tool call and sending a tool_result back to Claude (F067). The documented parallel API flow has a specific message-shape requirement (F068), and strict: true concerns schema conformance in tool definitions rather than proof that result content is true (F069). Apply those API facts only to integrations that expose them. For Claude Code work, inspect whether the actual result closes the evidence gap.

Why opaque status wastes the next step

A status such as “success” says that an operation finished. It does not say what the operation found. The next reasoning step may still need a path, a returned value, an error detail, a source line, or the scope of a search.

The missing evidence creates a choice. The agent can ask for the same information again, guess from the tool name, or produce a conclusion that the result never supported. Each route adds work or risk.

An opaque result also weakens human review. A developer cannot compare the conclusion with the observation if the observation was discarded. The summary becomes the only record, even when the underlying output contained the decisive detail.

The verification evidence guide supports asking for evidence rather than trusting a completion summary. The false-success discussion explains a related problem in generated verification. This article stays on the tool-result boundary: did the return value contain what the caller needed?

There is a cost to returning everything. Raw logs, unrelated records, and repeated source text can bury the decisive line. The goal is not maximal output. The goal is a result that closes the specific evidence gap without making the caller reconstruct it.

The MCP output-truncation discussion covers a different mechanism. This article does not repeat its truncation guidance. It focuses on what a result should communicate even when the output is complete.

What the official evidence establishes

Official (F067). The tool-use overview describes an application executing a tool call and sending a tool_result back to Claude. That is the Messages API loop, not a specification of Claude Code’s built-in tools.

Official (F068). The parallel-tool documentation requires all tool results together in a single user message without preceding text for the documented parallel API flow. The rule does not define interactive prompt formatting.

Official (F069). The tool-use overview documents strict schema conformance through strict: true in tool definitions. Schema conformance does not establish that result content is true or sufficient.

Official (F078). Claude Code best practices recommends asking for evidence of completion rather than trusting a summary. The principle supports result inspection, but it does not prescribe one universal result schema.

The handle-tool-calls page and define-tools page are canonical-link-only in this batch. No detailed mechanics are inferred from them. The prompting best-practices page supports source grounding through F047, not a mandatory result format.

Tool result evidence map connecting call purpose, status, evidence payload, and interpretation
Editorial map based on official API facts F067-F069. It does not define a universal schema for Claude Code built-in tools.

State why the tool was called

A result should make sense against the call’s purpose. If the call asked for the current status of one record, the result should answer that question. If the call searched for direct consumers, the result should report the inspected scope and the matches.

Record the purpose beside the result design. A compact statement is enough: “Find the direct caller and return its path and mapping.” The statement becomes the contract that the result must satisfy.

Separate purpose from implementation. A tool named lookup might read a database, a file, or a remote service. The caller usually needs the returned evidence, not the internal implementation detail. Include implementation context only when it changes interpretation.

The tool schema guide helps make the input side clear. A precise input reduces ambiguity about what was requested. A precise result closes the other half of the exchange.

Tool call purpose Required result evidence Insufficient result
Locate a definition Path, symbol, and relevant excerpt Found
Inspect a caller Caller location and observed mapping Read completed
Check a returned value Value, case, and observation scope Success
Search for consumers Inspected scope, matches, and exclusions No issues
Apply an edit Changed location and resulting content or diff Done
Verify a behavior Case, observed result, and remaining gap Passed

The table is an editorial design aid. It is not an API schema and does not claim that every tool should return the same fields.

A clear purpose also supports failure handling. If the operation could not finish, the result should say which part failed and what evidence remains available. A caller cannot distinguish a missing record from an unavailable service when both arrive as the same generic error.

Return the requested evidence

Put the decisive evidence in the result itself. A path without the relevant line may force another read. A count without the matching records may hide a contradiction. A diff without the affected contract may omit the reason the change matters.

Official (F047). Prompting guidance recommends grounding long-context responses in quotes from source material. A focused quote or observed value can make the result traceable. Include enough surrounding context to interpret it, but avoid unrelated output.

Evidence can take several forms:

  • A source location and the relevant symbol or block.
  • An observed value tied to the input that produced it.
  • A focused set of matches with the inspected scope.
  • A changed block or diff tied to the edit target.
  • A missing field or absent match with the search boundary.

The file reference guide explains why a pointer alone may not answer the question. The same applies to results. A path tells the caller where evidence lives; the relevant excerpt tells the caller what the evidence says.

Keep identifiers intact when they matter. Truncating a symbol name, record identifier, or error code can make the result impossible to reconcile with the call. If the integration must shorten output, preserve the fields needed to interpret the decision and state what was omitted.

Do not convert raw evidence into a confident recommendation inside the result. The caller may need to combine several results before choosing an action. Return observations first, then offer interpretation in a separate field or section.

Use an explicit result status

Status should describe the outcome without replacing the evidence. Useful distinctions include completed, completed with missing data, and failed. Those labels are editorial examples, not universal API values.

A completed status means the requested operation finished within its stated scope. It does not mean the caller’s broader question is solved. A partial status should name the missing portion. A failed status should preserve any useful evidence produced before the failure.

The parallel tool call guide describes is_error for a dependent call skipped because a dependency failed (F066). That convention belongs to the documented API flow. Do not assume the same label appears in every Claude Code result.

Status What it establishes What it does not establish Required companion evidence
Completed The requested operation finished The conclusion is correct or complete Observed result and scope
Partial Some requested evidence is available Missing evidence can be inferred Available evidence and named gap
Failed The operation did not finish as requested No useful evidence exists Failure detail and any preserved output
Skipped A dependent operation did not run The intended behavior was checked Dependency and reason for skipping

Avoid a success status with an empty payload. It forces the caller to treat tool activity as proof. Avoid a failure status that discards a useful observed value. The status should organize the evidence, not erase it.

Include the relevant source or location

Location makes evidence reviewable. A source path, symbol, input identifier, or observation scope lets the caller connect the result with the task. It also helps a developer reproduce the reasoning later.

Use the most stable locator available. A symbol may be more durable than a line number. A record identifier may be more precise than a table name. A case label may be more useful than a generic “test output” heading.

The exact edit target guide applies a related principle to edits. A unique anchor reduces ambiguity about the intended block. For results, a unique source locator reduces ambiguity about where the evidence came from.

Location is not authority. A path can point to stale code, a fixture, or untrusted text. The MCP trust-boundary guide and agent harness security analysis explain why evidence still needs evaluation.

A result should also identify its observation time or task phase when older and newer outputs can be confused. The fact pack does not prescribe a timestamp format. Use the project’s verified convention rather than inventing one here.

Keep explanations separate from raw evidence

Raw evidence records what happened. Interpretation explains what the result may mean. Combining them in one unlabeled paragraph makes it hard to tell whether a statement was observed or inferred.

Use separate sections when the distinction matters:

Status: partial
Question: Does the caller preserve the paid state?
Evidence:
  Source: fictional caller mapping
  Observed: pending and failed are handled; paid is not shown.
Missing: Another direct consumer has not been inspected.
Interpretation: The omission may explain the returned status.

This block is illustrative, not an API payload or a report about a real repository. Its value comes from separating the observation, the gap, and the hypothesis.

A caller can then test the interpretation against other results. If another consumer handles paid, the hypothesis may need revision. The raw evidence remains useful even when the interpretation changes.

The claim and evidence approach supports making conclusions reviewable. The context relevance guide supports including only evidence that can change the decision.

Avoid hiding uncertainty in polished prose. A direct sentence such as “The second consumer was not inspected” is more useful than a confident summary with a vague caveat at the end.

Tool result workflow separating call purpose, raw evidence, status, and interpretation
Editorial workflow based on F067 and F078. The separation improves traceability but does not guarantee a correct conclusion.

Handle missing data explicitly

Missing data should be a visible result state, not an empty field that the caller must interpret. Name what is missing, why it is missing when known, and whether the gap blocks the next decision.

Distinguish three cases:

  • Not requested: The call never asked for the item.
  • Not found: The requested inspection completed without a match.
  • Unavailable: The item could not be inspected because of a failure or access problem.

The distinction matters. “Not found” can support a bounded absence claim. “Unavailable” cannot. A result that reports both as an empty list destroys that difference.

The investigation-before-answer guide explains how to request evidence gathering without forcing a particular method. A good result lets the caller decide whether to broaden the search, change the source, or ask a human.

Missing-data case Honest result wording Next action
Not requested The call did not include consumer evidence Issue a scoped follow-up if needed
Not found in inspected scope No match appeared in the named modules Decide whether the scope is sufficient
Unavailable The source could not be inspected Resolve access or choose another source
Partial output The relevant excerpt is present; remaining records were omitted Decide whether omission blocks the claim
Contradictory evidence Two sources disagree on the contract Preserve both and resolve the requirement

Avoid inventing a value to fill a gap. A plausible default can be worse than an explicit unknown because it looks like evidence. The ambiguous requirements guide helps separate a discoverable fact from a product decision that no tool can supply.

When a dependency fails, preserve the reason and any completed independent evidence. The parallel tool call guide covers the API convention for skipped dependent calls. The broader lesson is to keep the evidence state visible.

Preserve the API message contract where required

Official (F068). The documented parallel API flow requires all tool results together in a single user message without preceding text. A direct integration must follow that contract for that flow.

The requirement concerns message structure, not the quality of each result. An application can satisfy the shape and still return empty or misleading evidence. Check both dimensions separately.

Do not generalize F068 to interactive Claude Code prompts. The fact pack explicitly limits the rule to the documented API flow. Interactive users should inspect the evidence available in their actual session rather than rearranging chat messages to imitate an API payload.

API result concern Documented fact Practical check
Execution loop Application returns tool_result (F067) Result corresponds to the executed call
Parallel message shape Results together, no preceding text in that flow (F068) Integration follows the documented contract
Strict definitions strict: true concerns tool definitions (F069) Schema conformance is not mistaken for semantic truth
Skipped dependency is_error convention exists for that API case (F066) Skipped is not reported as completed

The OpenAI and Anthropic API compatibility resource can help with format questions in a separate gateway integration. Compatible shapes do not prove identical tool behavior or evidence quality.

The deferred tool discovery guide concerns which definitions enter context. It does not change the need for a result that answers the call’s purpose.

Check whether the result answered the question

Compare the result with the original purpose before synthesizing an answer. A result can be valid but irrelevant. A search can complete while inspecting the wrong scope. An edit can apply cleanly while missing the protected contract.

Official (F078). Claude Code best practices recommends asking for evidence of completion rather than trusting a summary. Use that principle at the result boundary: ask what was observed and what remains unknown.

A result review can be short:

Review question Pass condition
Did the result address the call’s purpose? The requested evidence is present
Is the evidence located? Source, input, or scope is identifiable
Are status and payload consistent? Missing or failed work is not labeled complete
Is interpretation separate? Observations can be inspected independently
Are contradictions preserved? Conflicting evidence is not silently dropped
Is the remaining gap named? The next action has a clear target

The task checkpoint guide can record a partial result without treating it as completion. The session handoff guide helps carry the evidence gap into another session.

If the result does not answer the question, issue a focused follow-up rather than repeating the broad call. Name the missing field or scope. A precise correction is easier to review than an unbounded retry.

Worked example: a status lookup with a partial result

Consider a fictional tool call that asks whether a caller preserves a successful state. The tool can inspect one mapping but cannot access a second consumer.

An opaque result says:

Success

A useful result says:

Status: partial
Purpose: Check whether the caller preserves the paid state.
Evidence:
  Source: fictional caller mapping
  Observed values: pending, failed
  Missing from the inspected mapping: paid
Scope: One caller mapping was inspected.
Not inspected: A second direct consumer.
Interpretation: The omission may explain the returned status, but the consumer gap remains.

Both blocks are illustrative. The second does not prove the cause. It gives the caller enough evidence to inspect the mapping, preserve the uncertainty, and request the second consumer.

Suppose another result shows that the second consumer expects paid. The interpretation can now be tested against both consumers. If the contract is still unclear, stop for a product decision rather than asking the tool to invent one.

The acceptance examples guide helps define a concrete case for the follow-up. The observable requirements guide keeps the accepted behavior separate from the implementation hypothesis.

For an edit result, apply the same contract. Return the changed location, the resulting block or focused diff, and any unverified consumer. “Done” does not reveal whether the edit touched the intended mapping or created a new mismatch.

Practical result contract

Use this contract when designing a custom integration or reviewing results in an existing workflow.

Element Question it answers Failure mode to avoid
Purpose Why was the tool called? Result addresses a different question
Status Did the requested work finish? Success hides missing evidence
Evidence What was observed? Summary replaces raw output
Location Where did the evidence come from? Untraceable value or excerpt
Scope What was and was not inspected? Bounded search becomes universal proof
Missing data What remains unknown? Empty field invites guessing
Interpretation What may the evidence mean? Inference is presented as observation
Next gap What action is now blocked? Caller repeats the same broad call

The tool schema guide supports clear inputs. The result contract supports clear outputs. Neither side guarantees correct behavior on its own.

The context audit guide can reveal whether an important result actually entered the session. A well-designed result that never reaches the caller cannot close the evidence gap.

The cost per verified change framework supports measuring the cost of repeated calls and correction. This article does not assign a fixed saving to a better result contract.

Tool result tradeoff comparing opaque status with focused evidence and an explicit missing-data gap
Editorial tradeoff based on F067 and F078. More detail helps only when it remains relevant to the call’s purpose.

Win, loss, and practical implication

Concrete win. In the fictional lookup, a partial result names the inspected mapping, the observed values, and the uninspected consumer. The caller can request the missing consumer without repeating the first inspection or treating the partial result as proof.

Concrete loss. A result can satisfy a strict schema and still contain the wrong source, an incomplete excerpt, or an interpretation presented as fact. F069 explicitly separates schema conformance from truth and sufficiency. More fields do not repair bad evidence automatically.

Practical implication. Design results around the question that caused the call. Keep status, evidence, location, scope, and missing data visible. Inspect the result before synthesizing an answer, and preserve the API message contract only where the documented integration requires it.

Tool result control checklist for purpose, status, evidence, source location, and missing data
Editorial checklist derived from F067-F069 and F078. It is not a mandatory schema for built-in Claude Code tools.

Data gaps and future updates

Verdict on treating tool results as evidence contracts that answer the question behind the call.
Editorial verdict derived from F067-F069 and F078. A useful tool result answers the question that justified the call.

The fact pack contains no universal result schema for Claude Code and no benchmark connecting a particular result format with answer quality. F067 and F068 describe Messages API behavior. They should not be expanded into a specification of interactive tool internals.

The handle-tool-calls and define-tools pages were canonical-link-only. A future update should verify their current details before adding field-level API instructions. Any measured benefit should name the integration, task, comparison, and observed outcome.

Community reports: None are cited. No reproducible community run is present, so no anecdote is used to fill the schema or quality gap.

One AI API Key option for OpenAI-format agents

For a separate OpenAI-format agent, One AI API Key offers one key at https://api.oneaiapikey.com/v1 and 46 live free IDs in the checked batch record. Its Claude IDs were unavailable on 2026-11-27, so those free IDs must not be presented as a Claude Code model source. Review the free model listing for the OpenAI-format option and the cost calculator when comparing a custom integration.

FAQ

Is a success status enough for a tool result?

No. It establishes that an operation reports completion, not that the requested evidence is present. Include the observed evidence, source or scope, and any missing data.

Does strict: true guarantee a useful result?

No. F069 concerns strict schema conformance in tool definitions. A conforming definition does not prove that the returned content is true, relevant, or sufficient.

Should every tool use the same result schema?

No universal schema is established here. Match the result to the call’s purpose. Common elements such as status, evidence, location, scope, and gaps can still make results easier to review.

Does the parallel API message rule apply to Claude Code chat?

Not on this evidence. F068 is specific to the documented parallel API flow. Do not present it as an interactive prompt-format requirement.

More Claude Code troubleshooting

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
  • 100requests
    per day
  • 3Mtokens
    per day
  • 47free
    models
  • $0per
    token
  • No card
  • No end date
Claim $10 credit →