REFERENCE
SDK Demos
How to use @asgard-js/core and @asgard-js/react, with demos you can try on the page.
Tool Calls
When an agent invokes multiple tools (database queries, external APIs)
before producing its answer, the SDK automatically groups consecutive
tool-call messages into a Tool Call Group. Each entry can be
expanded to inspect its parameter and result.
Switch between scenarios below to see the pending, completed, and
error states.
Message Shape
Tool calls are not a template — they are a standalone
ConversationMessagetype:type ConversationToolCallMessage = {
type: "tool-call";
messageId: string; // `${processId}-${callSeq}`
eventType: EventType.TOOL_CALL_START | EventType.TOOL_CALL_COMPLETE;
processId: string;
callSeq: number;
toolName: string;
reason?: string; // backend-provided call reason; the tool-call group label and consent modal title prefer reason || toolName
toolsetName: string;
parameter: Record<string, unknown>;
result?: Record<string, unknown>;
isError?: boolean; // backend-reported failure flag (0.3.x / F-009); undefined until complete
toolUseId?: string; // this call's correlation id; an Agent tool's toolUseId becomes a subagent key (F-012)
parentToolUseId?: string; // non-empty means this call belongs to a subagent (F-012)
isComplete: boolean;
time: Date;
traceId?: string;
};In real usage these messages are written into the
Conversationautomatically whenEventType.TOOL_CALL_START/EventType.TOOL_CALL_COMPLETEevents arrive — you never have to construct them by hand.State Detection
State Condition pendingisComplete === falsecompletedisComplete === true && !(isError || result?.error)errorisComplete === true && (isError || result?.error)Since 0.3.x, backendisErroris the primary driverFailure detection now relies on the backend-reported
isErrorflag (F-009);result.erroris kept only as a legacy fallback.Built-in Tool Presentation (labels, icons, diff)
Since 0.3.x, the Tool Call Group synthesizes human-readable labels for built-in tools and pairs each with an identity icon (
variant):Tool Example label Read/Write/EditRead {file}/Wrote {file}/Edited {file}SkillRan skill {skill}WebFetch/WebSearchFetched {host}/Searched "{query}"Write/Editalso render a +/- line diff when expanded (theitems[].difffield, F-007).- Labels, the group summary (
{n} steps · …), and the expanded Initial / Result titles all follow thelocaleprop (en-US/ja-JP/zh-TW, F-004 / F-005 / F-008):
<Chatbot locale="en-US" config={{ botProviderEndpoint: '...' }} customChannelId="my-channel" />Further Reading
For the SSE event specs behind tool calls, see the Asgard developer docs: