Skip to content

InlineToolCall

Hero example

POST/v1/entities200 OK · 412ms

When to use

Reach for InlineToolCall whenever an agent has invoked a Matter API tool and the user should see what API call happened. Canonical mount: inside an assistant message row, between the assistant's prose and any rendered InlineCard ("I've drafted the consent. [InlineToolCall: POST /resolutions · 201 · 412ms]. Here it is: [BoardConsentCard]"). The pill carries enough information to verify the call without expanding into a full tool-call detail view.

Don't reach for InlineToolCall for non-API events (use Pill or a Timeline atom), for top-level navigation chrome (use EndpointBadge instead — it's tuned for documentation surfaces, not chat history), or for batched calls. If the agent ran 30 tool calls in a loop, render a summary InlineToolCall and link to the audit log.

Do — render InlineToolCall when an agent says "I just listed all your entities. [POST /entities · 200 OK · 412ms]."
Don't — render InlineToolCall for non-API operations like local computation or rendering. It's specifically a tool-call surface.

Anatomy

A single <div class="tool-call"> with four inline children:

  1. Status dot. 6×6 circle whose color resolves through data-status. ok → green, err → red, pending → amber. aria-hidden.
  2. Method. Bold mono, the HTTP verb (GET, POST, PATCH, DELETE, etc.). 11px, 0.04em letter-spacing.
  3. Path. Regular mono, the API path (/entities/ent_…). Truncates with ellipsis if it overflows the row.
  4. Meta. Mono. The status label (200 OK) plus a non-breaking · separator plus latency (412ms).

The whole pill is a single visual unit with no internal interactivity. If you need the tool-call to be clickable (open the audit-log detail), wrap it in an <a> or <button> at the consumer layer.

Props

PropTypeDefaultDescription
methodrequiredstring
pathrequiredstring
statusLabelstring"200 OK"HTTP status code rendered as `200 OK`, `404 Not Found`, etc.
latencystring"412ms"Round-trip latency rendered after the status, e.g. "412ms".
statusInlineToolCallStatus"ok"Drives the dot color + ring. Defaults to "ok".
classNamestring
styleReact.CSSProperties

statusLabel defaults to "200 OK" and latency defaults to "412ms" — these are demo defaults; production usage always passes real values.

States

Three semantic states driven by status:

statusDot colorWhen to use
ok (default)greenTool call succeeded. Status code 2xx.
errredTool call failed. Status code 4xx or 5xx.
pendingamberTool call is in flight. Dot pulses (collapses to static under reduced motion).

There's no cancelled or timeout state — those resolve to err with an appropriate statusLabel ("408 Timeout", "499 Cancelled").

Density

POST/v1/entities200 OK · 412ms
POST/v1/entities200 OK · 412ms

In compact, the pill height drops from 22 to 18px and font size from 11px to 10px. The dot stays 6×6.

Themes

POST/v1/entities200 OK · 412ms
POST/v1/entities200 OK · 412ms
POST/v1/entities200 OK · 412ms

Tokens consumed

colors17 tokensv2.3.0
#3FBF6E
matter
src ↗
#1b7a47
matter
src ↗
#E8A845
matter
src ↗
#8a5e1c
matter
src ↗
#8C8C8C
matter
src ↗
#5A5A5A
matter
src ↗
#6E8AD8
matter
src ↗
#3a5cb8
matter
src ↗
#1f8a5b
brand
src ↗
rgba(31, 138, 91, 0.1)
brand
src ↗
rgba(31, 138, 91, 0.35)
brand
src ↗
#6b7280
brand
src ↗
rgba(107, 114, 128, 0.1)
brand
src ↗
rgba(107, 114, 128, 0.3)
brand
src ↗
#b0322b
brand
src ↗
rgba(176, 50, 43, 0.1)
brand
src ↗
rgba(176, 50, 43, 0.35)
brand
src ↗

Dot color reads --status-green, --status-red, --status-amber based on data-status. Method bold reads --fg; path and meta read --fg-muted.

Accessibility

  • Keyboard interactions. None — the pill is non-interactive.
  • ARIA roles and properties. The dot is aria-hidden. The data-status attribute is CSS-only. The pill announces its full text content (method, path, statusLabel, latency).
  • Focus order. N/A.
  • Screen-reader expectations. Reading order: "{METHOD} {path}, {statusLabel} · {latency}." Avoid prepending the dot — it's aria-hidden.
  • Reduced motion. The pending state's dot pulse animation collapses to a static dot under prefers-reduced-motion: reduce.
  • Forced colors. Status dot collapses to ButtonText. Method, path, and meta inherit system foreground.
  • WIG rules. Mono caps via 0.04em letter-spacing (WIG typography minimum). Non-breaking space · separator between statusLabel and latency. aria-hidden on the decorative dot.

Do / Don't

Do — pass real statusLabel strings ("200 OK", "404 Not Found"). The format is HTTP-canonical.
Don't — synthesize status text ("Success", "Failed"). The user expects HTTP semantics in this surface.
Do — render pending tool calls with status="pending" and an explicit statusLabel="Pending". The pulse plus the label is the contract.
Don't — render a pending tool call without latency. Pending tool calls have elapsed time, not final latency — pass the elapsed time ("412ms…").
Do — truncate long paths via the tool-call__path recipe (built into the styles). Use the full path in a tooltip or in the audit-log detail view.
Don't — pass query strings or body fragments in path. Path is the route shape, not the full URL.

Recipes

This component appears in:

Code example

import { InlineToolCall } from "@matter/components";

export function AgentReplyToolCalls({ events }: { events: ToolCallEvent[] }) {
  return (
    <div className="agent-reply-toolcalls">
      {events.map((event) => (
        <InlineToolCall
          key={event.id}
          method={event.method}
          path={event.path}
          status={event.outcome === "success" ? "ok" : event.outcome === "in_flight" ? "pending" : "err"}
          statusLabel={event.status_display}
          latency={event.latency_ms ? `${event.latency_ms}ms` : undefined}
        />
      ))}
    </div>
  );
}

Source

packages/components/src/InlineCard/InlineToolCall

On this page