Tool Call CardPro
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.
oxyn add tool-call-card{ "query": "usage-based pricing pages", "limit": 5, "site": [ "stripe.com", "vercel.com" ] }
{ "results": [ { "title": "Stripe Billing pricing", "url": "https://stripe.com/billing/pricing", "score": 0.94 }, { "title": "Vercel pricing", "url": "https://vercel.com/pricing", "score": 0.91 }, { "title": "Linear pricing", "url": "https://linear.app/pricing", "score": 0.88 }, { "title": "Notion pricing", "url": "https://notion.so/pricing", "score": 0.81 }, { "title": "Figma pricing", "url": "https://figma.com/pricing", "score": 0.77 } ], "took_ms": 1180 }
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- An agent's tool call in one line: a tile with the kind icon, the tool name in mono, a summary that truncates, a live timer while running (from started) or the final duration, and the status (spinner, check, Failed).
- The header folds the card open to arguments and result, pretty-printed and lightly tinted (keys, strings, numbers, literals) with copy buttons; JSON strings are parsed, other text stays plain; while running without a result it reads “Waiting for result…”.
- Code is capped at max_code px with a fade and Show all.
- A failed call opens itself (unless toggled by hand) and shows the error with Retry; a retry closes the auto-opened card.
When not to use
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
- An agent's question in its own card above the composer: use Decision Card instead.
Installation
Tool Call Card is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add tool-call-cardUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Result
Success, open on arguments and a capped result with Show all.
{ "query": "usage-based pricing pages", "limit": 5, "site": [ "stripe.com", "vercel.com" ] }
{ "results": [ { "title": "Stripe Billing pricing", "url": "https://stripe.com/billing/pricing", "score": 0.94 }, { "title": "Vercel pricing", "url": "https://vercel.com/pricing", "score": 0.91 }, { "title": "Linear pricing", "url": "https://linear.app/pricing", "score": 0.88 }, { "title": "Notion pricing", "url": "https://notion.so/pricing", "score": 0.81 }, { "title": "Figma pricing", "url": "https://figma.com/pricing", "score": 0.77 } ], "took_ms": 1180 }
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Running
Live timer and Waiting for result…; settles after 2.6 s.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Error
Failed: opened on error, Retry runs it again.
{ "query": "usage-based pricing pages", "limit": 5, "site": [ "stripe.com", "vercel.com" ] }
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Group
A group header that sums the calls (shimmers while one runs).
{ "query": "usage-based pricing pages", "limit": 5, "site": [ "stripe.com", "vercel.com" ] }
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ToolCallCard
| Prop | Type | Default | Description |
|---|---|---|---|
cardrequired | CallCard | — | Card state. |
nowrequired | ClockMs | — | Shared clock. |
icon | String | "tool" | Icon in the tile. |
max_code | u32 | 220 | Code height cap, px. |
on_toggle | EventHandler<()> | — | Header toggled. |
on_retry | Option<EventHandler<()>> | Default::default() | Retry pressed (shows the button). |
ToolCallGroup
| Prop | Type | Default | Description |
|---|---|---|---|
cardsrequired | Vec<CallCard> | — | Cards. |
nowrequired | ClockMs | — | Shared clock. |
open | bool | true | Open. |
on_open | EventHandler<bool> | — | Header toggled. |
on_toggle | EventHandler<usize> | — | A card toggled. |
on_retry | EventHandler<usize> | — | Retry a card. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Header, copy buttons, Retry, Show all |
| EnterorSpace | Open or close the card or the group |
Accessibility
- The header is a button with aria-expanded; status is text (Failed, a check with its duration).
- Copy buttons are named Copy arguments / Copy result.
From the spec
- Header button with aria-expanded; statuses are text.
- Copy buttons named Copy arguments / Copy result; the clipboard text is in data-copy for the host.
Motion & interaction
Timing
- The body rises 5 px in over 200 ms; the chevron turns on the same curve.
- The group label shimmers while any call runs and settles to solid.
- Reduced motion: no entrance rise or row stagger, no shimmer (static muted text), chevrons and the card morph jump to their end state.
Responsive behaviour
- The summary truncates first; name, status and time keep their width.
Edge cases (spec)
- Summary truncates first; name, status and time keep their width.
Notes for AI
- Import
ToolCallCard,ToolCallGroupfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
ToolCallCardElinoxyn_gpui. - Props to set first:
card,now,cards,now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.