Skip to main content
Glama

trace_script

Run an unchanged Python script with tracing enabled to record calculations and source coordinates, returning a tape ID for inspection or replay at new inputs.

Instructions

Run a Python script with tracing on and keep the record (tape) it leaves. The script needs no changes: it runs in its own directory with AADC_TRACE=1, so every calculation through aadc types or an AADC-built library such as aadc-quantlib-tracing is recorded with its source coordinates. Returns tape_id, the script's stdout and stderr, the engine's census (frozen branch sites, outputs) and stats. A script that records itself and ends with f.save_tape() writes to AADC_TRACE_OUT; mark its first line with 'mode=explicit'. outputs: optional AADC_TRACE_OUTPUTS entries, e.g. ['value=123.45'] or ['pricer.py:42'], to name the program's results on the tape. python: another interpreter to run under (the one where the user's packages live). This runs the user's own code on the user's own machine; it is not a sandbox.

Input Schema

NameRequiredDescriptionDefault
argsNo
pathYes
pythonNo
outputsNo
workdirNo
timeout_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the burden and does so well: it discloses the tracing environment variable, that the script runs in its own directory, the outputs (tape_id, stdout, stderr, census, stats), and the important caveat that this is not a sandbox and executes the user's own code. It omits details on filesystem side effects beyond AADC_TRACE_OUT and on failure/timeout behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and result, then layered detail. Dense but mostly purposeful; the run-on clause about AADC_TRACE could be trimmed. Nothing is repeated from the schema verbatim.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description supplies the return shape and the safety caveat that an agent needs. Remaining gaps are the undocumented 'args' and 'timeout_s' parameters and what happens on timeout or script failure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It meaningfully explains 'outputs', 'python', and the explicit-mode convention, and implies 'workdir' via 'runs in its own directory', but 'args', 'path', and 'timeout_s' are left entirely to field names. Partial compensation for a six-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: run a Python script with tracing enabled and retain the resulting tape. It is concrete about the mechanism (AADC_TRACE=1, recording through aadc types) and distinguishes itself functionally from tape-reading siblings by producing a tape_id. It does not explicitly name a sibling (e.g. run_example) to contrast against, keeping it at 4.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear conditional guidance: the script needs no changes, and a self-recording script ending in f.save_tape() must be marked 'mode=explicit' on its first line. It also tells the agent that 'python' is for running under the interpreter where the user's packages live. No explicit when-not or sibling-alternative routing is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.