DevTools Logo

Tool Call Log Formatter

Tool Call Log Formatter

Turn raw OpenAI tool_calls or Anthropic tool_use logs into a readable, numbered agent transcript.

Runs in your browser
Try an example

Raw agent log

empty · raw

Detected format: raw · 0 bytes · 5 MB cap

Parsing, pairing and export happen only in this tab. Nothing is replayed or executed.

Transcript

0 of 0 steps

No log pasted yet

Try the OpenAI or Anthropic example to see calls paired with their results.

Examples

OpenAI dump

Input
choices message with two tool_calls plus a tool result line
Output
Two numbered steps, first paired with its result

Stringified arguments become syntax-highlighted JSON objects.

Anthropic blocks

Input
tool_use tu_1 and tool_result tu_1 in one content array
Output
One step with an inline result preview

Pairing uses the id, never array position.

Orphan result

Input
tool_result with an unknown tool_use_id
Output
Step labeled 'orphan result'

Missing calls are visible instead of being silently dropped.

Log prefix

Input
INFO 12:00 {"name":"lookup","arguments":{}}
Output
Generic step with a prefix warning

The brace-depth scan keeps the balanced JSON region and reports what it discarded.

About this tool

The Tool Call Log Formatter converts raw agent transcripts into a readable, numbered step list. It recognizes OpenAI tool_calls objects, Anthropic tool_use/tool_result content blocks and generic objects with a name plus arguments or input, then renders each call with parsed JSON arguments and a paired result preview.

A salvage pass handles real log files: it can read NDJSON line by line, skip non-JSON noise, and extract the largest balanced JSON region from lines with timestamps or INFO prefixes, ignoring braces inside string literals. Stringified arguments are parsed when possible and shown verbatim with a warning chip when they are not.

Results are matched by call id, with duplicate or unmatched ids surfaced as orphan steps rather than guessed away. Filter by tool name or search text, expand long results, copy the transcript as Markdown for a bug report, or download extracted steps as JSON. Parsing, highlighting and export all happen in the browser.

What this tool does not do

  • Only three common provider shapes are understood; other agent frameworks fall back to generic detection or raw text.
  • Very large traces above 5 MB are refused before parsing, and result bodies are previewed rather than fully rendered by default.
  • Highlighting is JSON token coloring, not a schema validator: a parsed argument can still be semantically wrong.

How to use this tool

  1. Paste or load a log

    Use the OpenAI or Anthropic example, or load a .json, .jsonl or .log file up to 5 MB.

  2. Check the detected format

    The header badge shows OpenAI, Anthropic, Generic or Raw; warnings explain skipped lines or discarded log prefixes.

  3. Read and filter

    Expand a step to inspect highlighted arguments and its full result; use the tool dropdown and search box to narrow long traces.

  4. Export the transcript

    Copy Markdown for an issue report or download either the Markdown transcript or the extracted step JSON.

Use cases

Incident debugging

Read a failed multi-step agent run without manually unescaping nested JSON.

Harness review

Inspect eval transcripts for malformed arguments and unpaired tool results.

Bug reports

Copy a filtered transcript as Markdown with arguments in fenced code blocks.

Supported input shapes

ShapeDetection
OpenAIchoices[].message.tool_calls
Anthropiccontent[] with tool_use / tool_result
Genericname plus arguments or input

Otherwise the tool reports 'no tool calls detected' and offers a raw parsed-steps view instead of inventing structure.

Common mistakes

Mistake:Assuming every tool result appears next to its call.

Fix:Pairing is id-based across the whole log; check the orphan chips when ids do not line up.

Mistake:Pasting a log with ANSI colors and expecting clean previews.

Fix:CSI sequences are stripped from previews; the raw parsed-steps view keeps the original text.

Mistake:Expecting the tool to re-run a failed call.

Fix:Nothing is executed or replayed; the formatter only reads the transcript you supply.

Frequently asked questions

How do I read OpenAI tool_calls from a log file?

Paste the JSON or NDJSON lines, or use the file picker. The formatter looks for choices[].message.tool_calls, parses each function.arguments string, and shows the call id, tool name and arguments as a numbered step. A separate message with the same tool_call_id is attached as that step's result.

What is the difference between tool_calls and tool_use?

OpenAI emits tool_calls inside an assistant message with a function name and a JSON string of arguments. Anthropic emits content blocks of type tool_use with an id and an input object, followed by tool_result blocks. Both are normalized here to the same step shape, so you can read either log the same way.

Does it pair calls with their results automatically?

Yes, by id: tool_call_id for OpenAI and tool_use_id for Anthropic. If a result has no matching call, it is shown as an orphan step with an amber label; duplicate ids pair only the first occurrence so a mismatch is never hidden.

Is there a size limit?

Input is capped at 5 MB and the exact byte size is shown before parsing. Above the cap the tool refuses the paste with a clear message. Long result previews are truncated to 400 characters or eight lines, with an expand control for the full text.

Does my log leave the browser?

No. Detection, JSON parsing, salvage, syntax coloring and exports all run in this tab. No request is sent, and no tool call is replayed — the transcript is inert data.

What if my log has timestamps or INFO prefixes?

The salvage scanner finds the largest balanced JSON region while ignoring braces inside strings, discards the surrounding prefix and tells you what it skipped. NDJSON files are parsed line by line, with non-JSON log lines reported as warnings.