Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

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

Shell
netscript ui:add tool-call-card

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
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.

OwnerPropTypeOptionalDescription
ToolCallCardPropsnamestringNoFully-qualified tool name, e.g. `pkg.fn`.
ToolCallCardPropsargsstringYesSerialized invocation arguments.
ToolCallCardPropsresultstringYesSerialized result payload.
ToolCallCardPropsstatusToolCallStatusNoLifecycle status.
ToolCallCardPropsdefaultOpenbooleanYesOpen the disclosure by default.
ToolCallCardPropsclassstringYes
TypeScript
type ToolCallStatus = "running" | "done" | "error"
ToolCallCardProps extends Omit<JSX.HTMLAttributes<HTMLDetailsElement>, "class">

Keyboard

KeyAction
Enter/SpaceToggle 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.

Search all documentation

Type a term to search the documentation.