trace_execution

MCP tool from Codecalc by The-40-Thieves

python3 only. Runs the same sandboxed executor executecode uses, plus a per-line event trace (events: line/call/return/exception, changed locals per step) and a static branch/line-coverage report (branches, linesexecuted, linesneverexecuted) from an AST parse — answers "which lines ran, in what orde

How to use it

Project documentation lists trace_execution for the Codecalc MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), then check which tools your installed version makes available. Tool availability can depend on configuration and credentials. A server handshake does not verify this tool’s behavior. See the full listing for setup details.

Install Codecalc

$uvx codecalc[full]
FULL CODECALC LISTING

Other tools in Codecalc (39)

algebraic_equiv

Are (ab)/c and a(b/c) identical? refactor verification (with float/truncation caveat)

analyze_complexity

Static Big-O estimate from code structure, parsed with tree-sitter (every supported language). Reports analysis: tree-sitter\

bits

Programmer-mode integer facts and operations, selected by mode: analysis (was bitanalysis), op (was bitop), widths (was intwidths), repr (was baserepr) — those four former standalone tools were retired in 0.12.0 (CHANGELOG.md)

branch_reachability

python3 only. Decides, with z3, which if/elif/else arms and while/for(range, static bounds) loops in ONE function can ever be taken for ANY input — reachable/dead/unknown per branch, a witness when reachable, and boundaryinputs (min/max/equality-edge, via z3 Optimize) shaped for compareedgecases's t

calc_exact

EXACT arithmetic: 0.1+0.2 == 0.3 is True; arbitrary-precision ints, bitwise ops inline, whitelisted math funcs, pi/e/tau

calc_stats

mean, median, sample stdev, CV (CV > 0.2 = noise swamps the effect)

collision_probability

Birthday-bound hash collision: 1e5 items/32 bits ≈ 0.69, 1e6/64 ≈ 2.7e-8

compare_edge_cases

Run the same logic in N languages on edge-case inputs (empty, zero, negative, float precision) and flag behavioral divergence

compare_threshold

Exact threshold verdict with shortfall: ('1/25', '>', '0.05') → False, shortfall 1/100

convert_units

Dimensional unit conversion via sympy: length, mass, time, speed, energy, power, force, pressure, temperature (°C/°F/K), volume, area, data, frequency

data_sizes

Byte sizes both ways: KiB/MiB (binary) AND KB/MB (decimal)

epoch_time

Epoch s/ms/µs/ns → ISO 8601 UTC, implausible readings suppressed

evaluate_expression

Symbolic math: integrate(x2, x), sqrt(144) + 210

execute_code

Run code in any language → stdout/stderr/exitcode/verdict (OK/TLE/MLE/OLE/RTE)/cpums/peakmemorykb; per-call limits (maxmemorymb, maxoutputkb, maxcpu), nonet, compact. With a session and no explicit maxoutputkb, oversized output spills into the session workspace (stdoutspill/stderrspill) instead of j

execute_code_stream

Provider-selected execution using the same canonical limits as executecode, with progress + partial output when the provider supports streaming

extract_function

Pull a named function + its dependency closure (imports, referenced helpers) into a standalone program and run it (ast-exact for python3, best-effort elsewhere)

float_repr

What binary64 actually stores: exact value, raw bits, ULP, neighbours, representable-or-not

human_duration

Humanised duration + per-day/per-30d rates

install_package

Install packages (uv pip/npm/gem/go/cargo...) into a session or shared cache

list_execution_providers

Execution-provider identity, interface version, host class, and machine-readable capabilities

list_languages

31 languages with extension, compile flag, runtime availability

list_units

All 140+ unit aliases for convertunits

matrix

Structured matrix ops: det/inverse/eigenvalues/transpose/rank/trace on a rows array — never a caller string through sympify, so evaluateexpression's [/] RCE screen never applies. Each entry screened individually

percentage

Exact share and percentage of PART/TOTAL (rationals accepted)

percentiles

p50/p90/p95/p99 by nearest-rank AND interpolation; warns n<100

physical_constants

22 physical constants with values (c, h, NA, kB, G, g, me, R, ...)

radix_convert

Any base 2..36, fractions included, non-termination flagged (0.1 base 2)

run_cancel

Cancel a background run; idempotent on an already-terminal run, honest about providers that cannot cancel mid-flight

run_inspect

Poll a background run: status while running, the full executecode result shape once terminal

run_submit

Submit code for background execution; returns a runid immediately instead of holding the call open

session_artifacts

List files created by executed code (results, images, CSVs)

session_run

Multi-file programs: execute an entry file that imports other session files (helper.py, data/...) in the workspace

session_snapshot

Archive a session's workspace to a snapshot stored OUTSIDE the jailed workspace (action="save"), or restore one into a new session or, with replace=True, back into the same session (action="restore"); action="list"/"delete" manage them. Files only — never a stateful session's REPL variables. Snapsho

session_start

Persistent session; python3/node get a stateful REPL worker (variables/imports persist across calls), other languages a workspace dir

symbolic

Symbolic algebra, selected by op: solve (was solveexpression), solvelinear (was solvelinear, name unchanged), simplify (was simplifyexpression), limit (was limitexpression) — those four former standalone tools were retired in 0.12.0 (CHANGELOG.md)

truth_table

Boolean algebra: a and b or not c, p xor q, a implies b

verify_optimization

Prove an optimisation: you write the candidate, the executor confirms it still agrees with the original AND times both — accepted only if equivalent and measurably faster. Accepted is graded crosschecked

verify_translation

Prove a port is equivalent: you write the translation, the executor runs both versions on the same inputs and reports match / diverged / inconclusive per input. A pass is graded crosschecked (see Grade vocabulary)

z3_check

SMT-LIB2 satisfiability + model. An unsat verdict is graded solverproven; sat is graded ungraded (decided, but not proof-shaped — see Grade vocabulary)