live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/agent-anthropic


@orangecheck/agent-anthropic / canonicalizeToolUse

Function: canonicalizeToolUse()

function canonicalizeToolUse(t: AnthropicToolUse): Uint8Array;

Defined in: index.ts:49

Produce the canonical bytes for an Anthropic tool_use. The bytes are what the agent-action envelope's content.hash is a SHA-256 of.

Shape (RFC 8785 canonical JSON, then trailing LF): { "id": <tool_use_id>, "input": <canonical JSON of input>, "name": <tool name> }

Parameters

ParameterType
tAnthropicToolUse

Returns

Uint8Array