affectUI › Components › Agents
Tool Calls Network
Every LLM and tool call of an agent run as rows, like the Network tab of the browser's developer tools – status, name with the tool's logo, the agent that made it, size and time, and a small waterfall where each call is a bar on the run's timeline, split into queued, waiting for the first token, streaming and tool execution. New calls stream in at the bottom while running bars grow at the "now" edge; drag across the overview strip for a stretch of time, filter by LLM, tools, errors or retries, sort like DevTools, and open a call for its request and response as pretty JSON, its timing phase by phase and every retry.
Part of affectUI Pro. Install: npx shadcn@latest add https://www.affectui.com/r/tool-calls-network.json · Import from @/components/ui/tool-calls-network
When to use
- Debugging an agent run call by call – every LLM and tool call as a row, like the Network tab of the browser's developer tools
- Finding the slow, failed or retried calls: filter to errors or retries, sort by time or size, and open one for its request and response
- Watching a run live – new calls stream in at the bottom and the waterfall follows the leading edge while it runs
When not to use
- Who called whom, as a tree of spans – use Trace Waterfall or Agent Flame Graph
- Which steps set the run's total time – use Critical Path
- A single tool call in a chat – use Tool Call Card
Usage
import { ToolCallsNetwork, type NetworkCall, type NetworkAgent } from "@/components/ui/tool-calls-network";
const agents: NetworkAgent[] = [
{ id: "planner", name: "Planner" },
{ id: "researcher", name: "Researcher" },
];
const calls: NetworkCall[] = [
{
id: "c1", agent: "planner", kind: "llm", name: "claude-opus-5.5", detail: "plan the release", icon: <ClaudeLogo />,
status: "done", start: 0, end: 7400, phases: { queued: 120, waiting: 1400 }, tokensIn: 4210, tokensOut: 1850, code: 200,
request: { model: "claude-opus-5.5", messages: [/* … */] }, response: { stop_reason: "end_turn" },
},
{
id: "c2", agent: "researcher", kind: "tool", name: "github.search_code", detail: "round( in billing/", icon: <GitHubLogo />,
status: "running", start: 19100, phases: { queued: 50 }, request: { q: "round( path:billing/" },
},
];
export function Run({ now }: { now: number }) {
return <ToolCallsNetwork title="Ship v2.4 – tool calls" calls={calls} agents={agents} now={now} />;
}Props
| Name | Type | Default | Description |
|---|---|---|---|
calls | NetworkCall[] | Every call – { id, name, detail?, kind, status, agent, start, end?, phases?, tokensIn?, tokensOut?, bytes?, code?, icon?, request?, response?, error?, retries? } | |
kind / status | "llm" | "tool" / "queued" | "running" | "done" | "failed" | LLM calls are tinted indigo, tool calls teal, failures red; a running call grows at the live edge | |
start / end | number | ms from the start of the run – leave end out while the call runs | |
phases | { queued?: number; waiting?: number } | Queued ms and the wait for the first token (LLM) – the rest is streaming or tool exec | |
request / response | unknown | An object or a string – JSON strings are pretty-printed, big bodies show their start with a Show all button | |
retries | NetworkAttempt[] | Earlier attempts, oldest first – { start, duration, code?, error? } | |
agents | NetworkAgent[] | { id, name, color? } – the pixel mark's color defaults to blue for the first agent, then a palette | |
now | number | The clock in ms from the start of the run – e.g. a faster one for a demo | |
startedAt | number | Epoch ms – without now the component keeps its own clock while anything runs | |
live | boolean | Whether the run still goes – defaults to true while a call is queued or running | |
openId / defaultOpenId / onOpenChange | string | null / (id, call?) => void | The call whose details are open – controlled or not | |
rows | number | How many rows show before the list scrolls – 12 by default; the height stays fixed | |
title | string | Names the list for screen readers | |
className | string | An extra class on the root |
Accessibility
- The list is a treegrid with one row in the tab order – ↑ ↓, PgUp PgDn, Home and End move; Enter or Space opens the details
- With the details open the arrows keep moving and the details follow; Esc closes them and focus goes back to the row
- The details' tabs move with ← → Home End; the request and response blocks can be focused and scrolled, each with a Copy button
- The filters are a radio group – one tab stop, the arrows pick; the column heads are buttons with aria-sort
- The overview strip takes the keyboard too: an arrow picks a time range, arrows move it, Shift and an arrow resize it, Esc clears it
- Every row reads as one line – "browser.open staging.acme.dev, Tool call by Test Runner, Failed 401, 1.4s"
- A focus ring shows only for the keyboard; the search field has none – its edge firms up instead
- The phases' legend is a tooltip on the Waterfall head – on hover and keyboard focus
Responsive
- Fills its container's width and never scrolls sideways; the list's height is fixed, so nothing jumps while calls stream in
- Narrower than 700px the agent column goes; narrower than 520px the size column too, the search gets its own row and the details take the whole width
- On a phone the footer keeps its marks and numbers on one line and "Live" becomes its dot
- Only the rows in view are drawn – 500 calls scroll as smoothly as 20
- Long names end in … with the full name on hover; big numbers shorten to 182.4K, 2.4B, 990 TB and are never cut
- Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
Requirements
- React 19
Related
- Trace Waterfall – Where the time and money of an agent run go – every LLM call, tool call and sub-agent as a bar on a live timeline, with tokens and cost per step, the slowest call marked and branches that fold into their parent
- Agent Flame Graph – A multi-agent run's call stack as a flame graph – the orchestrator on top, its subagents under it, then their LLM and tool calls, every block as wide as it took. Switch to Tokens or Cost and every block glides to its new width; click one and it slides out to the full width, with a breadcrumb back. Search lights up the matching blocks and says how much of the run they took; a failed call's card offers Retry. Agents carry their pixel mark, LLM and tool calls their maker's logo, and a live run keeps growing at its right edge
- Critical Path – An agent run's spans on a timeline, one lane per agent, with thin arrows from every span to the ones waiting for it. The chain that decides when the run ends is the critical path – its spans in full tint, its arrows solid, the rest fades back, and a quiet line says how much of the run it is. Drag the end of any span to try a what-if: everything that waits for it slides along, the end of the run moves, and the path hops to another chain when that one now ends last; a pill says how much earlier or later the run ends. Drag a span onto another lane to run it on that agent. Click a span for its card – the duration before and after, its slack, and what it waits for and unblocks; Reset brings the run back
- Tool Call Card – An agent's tool call in one line – live timer, status and summary, folds open to highlighted arguments and result with copy, retry on errors and a group that sums them up