Skip to Content
Foir AIReading a run

Reading a run

Every message an agent answers is a run, and every run keeps a trace: each model turn, each tool it called, each check and each child agent, in the order it happened, with what went in and what came out. When an agent does something you did not expect, the trace says why.

Where to find it

In the console, open Agents, choose the agent, then Runs. Each run shows who it was for, how it ended, and what it cost. Open one to see its trace.

A run is read by the person it was for, and by anyone holding agents:read for the project. A visitor’s run is read with the visitor’s own secret, the one their conversation is kept by.

What a run is made of

A run is a tree. Its root is the agent answering one message, and every step it took sits beneath:

StepWhat it is
Model turnOne call to the model: the model it ran on, the tokens it read and wrote, how long it took and what it cost.
VerbOne of Foir’s verbs the agent called, such as foir_list_records, with its input and result.
OperationOne of your operations, with its input and result. A read-only operation answers inline.
Remote toolOne tool of a remote MCP server.
CheckA check that refused something: a limit, the safety check, one of your refusal rules, or a tool the run was never offered. It names what refused.
AgentA child agent the run handed a task to, with its own steps beneath it.

A held act is a step with an approval: what it would do, who decides, and the decision once it is made.

How a run ends

StatusMeaning
COMPLETEDThe agent answered.
HELDAn act waits for an approval. The run carries on once it is decided.
SKIPPEDThe message was refused before the agent ran: a limit, a quota, the safety check, one of your rules, or no credits. Its answer says which, and it cost nothing.
FAILEDSomething went wrong while it ran. The trace shows the step that failed and why.
CANCELLEDThe person it was for stopped it.

What it cost

A run’s cost is the sum of its model turns, its children’s included, charged once for the whole run when it ends. A run on Foir’s models shows its cost in credits against the most the agent lets one run spend. A run on the project’s own key shows no credits: its spend is counted against the agent’s monthly cap on that key.

From your app

The generated API reads a run as the console does:

query Run($id: String!) { agentRun(id: $id) { status answer spentCredits nodes { id parentId kind # AGENT, OPERATION, VERB, MCP_TOOL, MODEL_TURN or CHECK key status error } } }

On the SDK client:

const run = await foir.ns.agents.agentRun({ id: runId }); const failed = run.nodes.filter((node) => node.status === 'FAILED');

A person reads their own runs this way. Follow a run that is still answering with the agentRun subscription instead: see Use an agent in your app.

Last updated on