In this article
A useful tool result tells the agent what operation happened, which artifact it concerns and what the observation actually establishes.
The next model decision depends on the observation returned by a tool. An integration therefore needs more than a pleasing status message. Codex’s app-server event model illustrates why identity, lifecycle and actual output should remain distinguishable, especially when a single task invokes several operations that finish at different times.
Name the operation and its target
Consider a hypothetical schema validator exposed to a coding workflow. Its result should identify the schema and the input revision being validated. “Validation passed” without those references cannot establish that the current generated client is compatible. A stable target reference lets the agent connect the observation to the files it is considering and avoid accidentally carrying an old success into a newer edit.
Represent running and finished states
The app-server protocol separates item start, updates and completion. A custom tool integration should preserve the same conceptual distinction even if its own schema uses different names. Returning a job identifier means work has been accepted or started; it does not mean its output is ready. The agent needs a supported way to obtain the final observation before making a claim based on it.
Return bounded diagnostic evidence
For a failed schema check, include the relevant field path and the mismatch rather than an entire unrelated log archive. Bounded evidence keeps the next decision focused. If the full output is important, retain it as an artifact and expose its location. The short result should still distinguish a validator failure from an invalid schema, since those conditions require different next actions.
Preserve machine fields and explanation together
Structured fields make tool results easy to route and validate, while a concise explanation helps the agent understand their meaning. Keep status, target and diagnostics separate rather than embedding all of them inside a sentence. The integration can then render a readable summary and preserve the exact fields needed by automation. Neither representation should silently replace missing output with a success assumption.
Test the observation contract
Use representative success, domain-error and execution-error fixtures for the hypothetical validator. Check whether a consumer can tell which condition occurred without interpreting incidental wording. Also test an unfinished operation, so the UI does not present its partial output as final. These focused fixtures establish the contract your integration owns; they do not claim that Codex has a particular private representation for every external tool.
Documentation and further study
Related engineering guides: Reproducible inference stacks: preserving a GPU pilot’s result; Choose a local AI stack: desktop chat, shared UI or coding agent.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.