Tool Call Group

An agent's tool calls folded into one line, "Read 4 files, ran 2 commands", that opens into each call.

I’ll swap the HTTP client for fetch with a retry wrapper, then run the API tests.

Done: requests retry on a 429 or 503, up to three times. The tests pass.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/tool-call-group

Usage

import { type ToolCall, ToolCallGroup } from "./ui/uicontext/components/kit/ToolCallGroup.ts"
export const Calls = <M>(h: Html.H<M>, id: string, calls: ReadonlyArray<ToolCall>) =>	ToolCallGroup(h, { key: id, props: { id, calls } })

API reference

Props

ToolCallGroup props
NameTypeDescription
idrequiredstringNames the group for agents
callsrequiredToolCall[]—
agentIdstring—
localestring—

Agent actions

What agents can do with ToolCallGroup
ActionDescription
ClickedHeaderOpen or fold the list of tool calls

Accessibility

  • The fold is a button with aria-expanded; the calls are an ordered list, each saying what it did in words, past tense once done.
  • A running call has a spinner named Running, and a failed one says Failed with its output beside it. Reduced motion stops the spinner.

Source