trace_save
Save AI agent interaction traces to disk for audit trails, creating JSON and Markdown files to document safety monitoring activities.
Instructions
Save the current trace to disk as JSON and Markdown files.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "trace_save"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/agent_safety_mcp/server.py:338-349 (handler)Implementation of the trace_save tool which saves the current tracer trace to JSON and Markdown files and returns a summary.
@mcp.tool() def trace_save() -> dict: """Save the current trace to disk as JSON and Markdown files.""" tracer = _get_tracer() json_path = tracer.save() md_path = tracer.save_markdown() return { "saved": True, "json": str(json_path), "markdown": str(md_path), "summary": tracer.summary(), }