Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-tool-call>

@methane-ui/ai~7.9 KB brotli (kit + Lit)~2.0 KB marginal

Collapsible AI tool invocation card displaying execution status, escaped JSON arguments, and sanitized text output.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-tool-call> (@methane-ui/ai)
Ready · interact with <mth-tool-call>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ai/tool-call"></script>
<mth-tool-call status="pending" duration-ms="null">Example</mth-tool-call>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""Invoked tool function name.
statusstatus'pending' | 'running' | 'success' | 'error'"pending"Current tool status (pending | running | success | error).
openopenbooleanfalseWhether arguments and output details are expanded.
args—unknown—JSON-serializable arguments payload.
output—unknown—JSON-serializable or text output payload.
durationMsduration-msnumber | nullnullOptional execution latency in milliseconds.

Events

EventDetail TypeDescription
mth-toggle{ open: boolean; status: string }Fired when the user toggles the tool details panel.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Enterbothtrigger button focusedexpands or collapses tool details
Spacebothtrigger button focusedexpands or collapses tool details

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 2 APG keyboard transitions across LTR/RTL.mth-tool-call.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(pending), :state(running), :state(success), :state(error).Conformance suite
i18nRoutes 8 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test