Machine-readable metadata for a registered tool — origin, version, and
runtime requirements in a stable shape consumers can inspect without
parsing the LLM-facing definition JSON.
Extract structured detail metadata from tool output. When multiple Detail
entries exist, they are merged into a single object. Returns None if no
Detail entries are present.
Extract the pictures a tool’s output hands the model to look at, in the
order they were produced — the image face of a tool result, exactly as
content_text is its textual face. Empty when the output carried none.
Join the textual portion of tool output into a single string for display
and session history. Non-text variants (e.g. Image, Detail) are skipped;
Artifact is skipped too — its model face is the summary+reference line
already carried in Text (the typed channel marks the artifact for UI).
Render a single tool’s definition into the OpenAI function-calling
envelope. Tools only provide name/description/schema; the envelope is
assembled here at the LLM boundary (Anthropic gets its own renderer, and
tool authors stay protocol-agnostic).