Kanshō

Docs / Tool calls /

ToolCallCard

Expandable receipt showing a tool's name, status, duration, token cost, input, and output. Supports card and row variants.

Preview

Input
{
  "path": "src/db/schema.prisma",
  "encoding": "utf-8"
}
Output
model User {
  id        String   @id @default(cuid())
  email     String   @unique
  createdAt DateTime @default(now())
}

model Session {
  id        String   @id @default(cuid())
  userId    String
  expiresAt DateTime
}

Variants

Row variant

Error state

Input
{
  "command": "npm run build",
  "cwd": "/workspace/frontend"
}
Error
Error: ENOENT: no such file or directory, open '/workspace/frontend/package.json'
    at Object.openSync (node:fs:600:3)
    at Object.readFileSync (node:fs:468:35)

Pending state

Atoms

StatusPill

PendingRunningSuccessFailedSkippedPaused

CostChip

1.8k$0.0124k$0.1499k$0.58

Props

PropTypeDescription
toolName*stringName of the tool being called, rendered in monospace.
status*"pending" | "running" | "success" | "error" | "skipped" | "paused"Current execution status — drives the StatusPill colour and error/output label.
durationMsnumberWall-clock time the tool call took, displayed as a short duration string (e.g. 420 ms, 1.4 s).
tokensnumberToken count for this call, shown inside a CostChip when provided.
costnumberUSD cost for this call (e.g. 0.01), shown inside a CostChip when provided.
inputRecord<string, unknown> | stringTool input — object is pretty-printed as JSON; string is shown verbatim. Rendered in a collapsible block.
outputRecord<string, unknown> | stringTool output or error — same rendering as input. Label changes to "Error" when status is "error".
scopestringShort scope badge shown in the card header (e.g. "filesystem", "network", "sandbox").
summarystringShort summary appended after the tool name in the row variant (e.g. "2 read", "14 entries").
variant"card" | "row""card" (default) renders a full card with a header row; "row" renders a compact single-line disclosure.
defaultOpenbooleanWhether the disclosure starts open. Defaults to false.
classNamestringExtra classes applied to the outermost element.

* required.

Usage

import { ToolCallCard } from "@/components/agent/tool-call-card";

<ToolCallCard
  toolName="read_file"
  status="success"
  durationMs={420}
  tokens={1840}
  cost={0.01}
  scope="filesystem"
  input={{ path: "src/db/schema.prisma" }}
  output="model User { id String @id }"
  defaultOpen
/>