normalize_trace
Normalize any tool-call trace into the canonical Agentsnap format and generate a SHA-256 fingerprint, enabling fast byte-level comparison between runs.
Instructions
Coerce an arbitrary tool-call trace (an array of {name,args} entries or a partial Trace object) into the canonical agentsnap Trace shape. Returns the normalized trace plus a SHA-256 fingerprint hash computed over the canonical (key-sorted) JSON, so two runs can be byte-compared cheaply.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | Optional input string to embed in trace.input. | |
| model | No | Optional model identifier to embed in trace.model. | |
| trace | Yes | Either an array of tool-call entries (each {name, args, result?, error?}) or a partial Trace object with a tools[] field. | |
| output | No | Optional output string to embed in trace.output. |