ToolCallCard
Inline MCP/tool invocation + result as a native <details> disclosure with status badge and IO panel.
All components · Theme builder · Implementation source
Live preview
Open live tool-call-card preview
Install
netscript ui:add tool-call-cardUsage and examples
The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.
import { useState } from 'preact/hooks';
import { ToolCallCard } from '@app/components/ui/tool-call-card.tsx';
export function Example() {
const [value, setValue] = useState('standard');
const [open, setOpen] = useState(false);
const [notice, report] = useState('');
return (<><div><ToolCallCard name="orders.lookup" status="done" args={JSON.stringify({id:"SO–10480"})} result="Order shipped" /></div><p role="status">{notice}</p></>);
}Props
Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.
| Owner | Prop | Type | Optional | Description |
|---|---|---|---|---|
ToolCallCardProps | name | string | No | Fully-qualified tool name, e.g. `pkg.fn`. |
ToolCallCardProps | args | string | Yes | Serialized invocation arguments. |
ToolCallCardProps | result | string | Yes | Serialized result payload. |
ToolCallCardProps | status | ToolCallStatus | No | Lifecycle status. |
ToolCallCardProps | defaultOpen | boolean | Yes | Open the disclosure by default. |
ToolCallCardProps | class | string | Yes |
type ToolCallStatus = "running" | "done" | "error"
ToolCallCardProps extends Omit<JSX.HTMLAttributes<HTMLDetailsElement>, "class">Keyboard
| Key | Action |
|---|---|
Enter/Space | Toggle disclosure |
Tokens
Semantic contract roles: border/default, destructive/border, destructive/text, radius/input, space/stack/gap, success/text, surface/surface, text/muted.
CSS custom properties referenced directly: --ns-border, --ns-border-width, --ns-code-bg, --ns-destructive-border, --ns-destructive-text, --ns-ease-fast, --ns-fg, --ns-focus-ring-offset, --ns-focus-ring-width, --ns-font-eyebrow, --ns-font-mono, --ns-label-tracking, --ns-leading-label, --ns-leading-normal, --ns-muted, --ns-muted-fg, --ns-prose-code-line, --ns-prose-code-size, --ns-radius-control, --ns-radius-input, --ns-radius-md, --ns-radius-sm, --ns-ring, --ns-space-1, --ns-space-2, --ns-space-3, --ns-space-5, --ns-success-text, --ns-surface, --ns-surface-raised, --ns-text-2xs, --ns-text-label, --ns-text-xs, --ns-tracking-label, --ns-tracking-wide, --ns-weight-label.
Contract and compatibility
Accessibility pattern: WAI-ARIA guidance
- Native DOM attributes pass through where the implementation accepts them.
Design contract values marked planned are not implementation props. The props above describe what ships today.