codecalc
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_languagesA | List every language codecalc can execute, with extension, compile flag, and what this machine resolved.
|
| list_execution_providersA | List execution providers (execution BACKENDS — local subprocess, gVisor-strict, remote) and their machine-readable capabilities. This is about which BACKEND runs your code, not which LANGUAGE it runs —
a provider's |
| execute_codeA | Execute Returns stdout, stderr, exit_code, duration_ms, cpu_ms, peak_memory_kb, verdict (OK/TLE/MLE/OLE/RTE).
With |
| session_startA | Start a persistent session. python3/node get a stateful REPL worker (variables/imports persist across execute_code calls); other languages get a persistent workspace directory. Returns session_id. |
| session_stopA | Stop a session: kill its REPL worker (if any) and delete its workspace. |
| session_listA | List active sessions and their languages/state. |
| session_filesB | List workspace files, optionally using a bounded cursor page. |
| session_write_fileA | Write a file into a session workspace (relative path, no escapes). Use this to seed input data for executed code. |
| session_artifactsA | List files created by executed code in a session (excluding runner internals like main.py/run.out). |
| install_packageA | Install a package for a language (uv pip / npm / gem / go get / cargo add...). With session_id, installs into that session's workspace so executed code can import it. Without, installs into a shared cache. NETWORK: yes, always. The package manager fetches from its registry (PyPI, npm, rubygems, crates.io). codecalc opens no socket itself; the child process does. NOT SANDBOXED: the installer runs as a direct subprocess of the server, so install-time hooks (npm postinstall, Python build backends, Cargo build scripts) execute with the server user's filesystem access. The environment is still restricted to the allowlist, so secrets do not leak, but the filesystem is not confined. Do not point this at untrusted input. See SECURITY.md. |
| execute_code_streamA | Execute code and STREAM progress + partial output as it runs. Unlike execute_code (which returns only at exit), this reports progress notifications to the client while the program runs, so agents can see output before the process finishes. Returns the same result shape and applies the SAME ceilings: max_memory_mb, max_output_kb and max_cpu are forwarded to the executor exactly as execute_code forwards them. One difference, deliberate: the wall-clock cap is 300s here against execute_code's 120s, because streaming exists for runs long enough to want progress. |
| run_submitA | Submit code for BACKGROUND execution; returns a run_id immediately. Same request shape as execute_code (minus session_id: a run is a standalone process, not a session workspace). The work proceeds on a background worker; poll it with run_inspect(run_id) and, if needed, stop it early with run_cancel(run_id). Use this instead of execute_code when you would rather not hold an MCP
call open for the whole computation. Admission is capped (CODECALC_MAX_ACTIVE_RUNS, default 64): past that many runs still running/cancelling at once, this returns a resource_exhausted error rather than growing without bound — call run_inspect/run_cancel to make room, or wait for one to finish. Retention: see run_inspect. |
| run_inspectA | Poll a background run started with run_submit. While running: {"ok": True, "state": "running"|"cancelling", "run_id", "provider_id", "started_at", "deadline"}. Once terminal ( Retention: a finished run's result stays inspectable for the life of this server process — call this as many times as you like; nothing is consumed by reading it. What IS released on the first terminal read is the PROVIDER's own resources for that run (RunSupervisor.cleanup(), idempotent on repeat calls) — the in-memory record of the run itself is not evicted; there is no cap or TTL on it here, deliberately: the durable state machine, leases and TTL-based eviction are out of this residual's scope (see run_supervisor.py's own docstring). A long-lived server that calls run_submit very many times will grow this table; the on-disk crash-recovery journal underneath it is already bounded (RunSupervisor.max_completed), independent of this. |
| run_cancelA | Cancel a background run started with run_submit. Idempotent: calling this on a run that is already finished/cleaned
reports Propagation depends on the SELECTED PROVIDER (see
list_execution_providers' |
| evaluate_expressionC | Symbolically evaluate or simplify a math expression, e.g. 'integrate(x2, x)' or 'sqrt(144) + 210'. |
| truth_tableA | Build the truth table for a boolean expression: 'a and b or not c', 'p xor q', 'a implies b'. |
| z3_checkA | Check an SMT-LIB2 formula with Z3: sat/unsat/unknown plus a model. Example: '(declare-const x Int)(assert (> x 5))(check-sat)'.
|
| solve_linearA | Solve a system of equations; |
| matrixA | Structured matrix operations: det, inverse, eigenvalues, transpose, rank, trace.
|
| analyze_complexityB | Estimate the asymptotic (Big-O) time complexity of a code snippet via structural analysis. |
| benchmarkA | Empirically measure time complexity by running code at increasing input sizes. Contract: the code must read an integer N from stdin (first line) and do work
sized by N. codecalc runs it at each size in |
| compare_executionA | Run the same code in multiple languages side by side.
|
| runtimes_statusA | Check every language runtime for available updates (NON-MUTATING). Reports current vs latest version per language, which package manager owns
it (mise/rustup/swiftly/apt/npm/uv), and the exact command that would run.
Optional Each entry also carries NETWORK: yes. Non-mutating refers to this machine's runtimes, not to traffic — each package manager is asked what the latest version is, and they answer by contacting their own remote index. |
| update_runtimesA | Update language runtimes. SAFE BY DEFAULT: with apply=False this is a
dry run — it returns the update commands that WOULD run without changing
anything. Pass apply=True to actually execute them (mise up, rustup update,
swiftly update, apt-get upgrade of language packages, npm -g update, uv tool
upgrade). PRIVILEGE: the apt manager updates system packages and its command begins
with NETWORK: yes, on both paths. apply=False still asks each manager what the latest version is, which is a remote lookup; apply=True additionally downloads and installs. "Dry run" bounds what changes on disk, not what is sent. |
| session_read_fileA | Read a file from a session workspace. Text files return content. With as_image=True (or for image files), the file is returned as an inline image the model can see. Use session_files to discover paths; session_artifacts lists what executed code produced. |
| session_runA | Run a multi-file program in a session: execute Runs as a fresh process in the session workdir (not the REPL worker), so
relative imports and data files resolve. Returns stdout/stderr/verdict
plus the entry file's path. Oversized output spills into the session
workspace the same way execute_code's does — see its docstring for
|
| convert_unitsA | Convert a value between units (dimensional analysis via sympy). Supports metric/imperial length, mass, time, speed, energy, power, force, pressure, temperature (°C/°F/K), volume, area, data sizes, frequency. Examples: ('60','mph','km/h'), ('100','celsius','fahrenheit'), ('1','gb','mib'). Use list_units for the full alias table. |
| physical_constantsA | Look up a physical constant (speed_of_light, planck, avogadro, gravity, electron_mass, gas_constant, ...) or list all 22 with values. |
| list_unitsA | List every supported unit alias for convert_units. |
| calc_exactA | EXACT arithmetic: 0.1 + 0.2 == 0.3 is True here (False in plain Python). Everything is an exact rational, integers are arbitrary precision. Supports
|
| compare_thresholdA | Exact threshold check with a verdict and the shortfall when it fails.
|
| percentageA | Exact share and percentage of PART / TOTAL (rationals accepted). |
| calc_statsC | mean, median, sample stdev, and coefficient of variation (CV). CV > 0.2 means run-to-run noise swamps the effect being measured — the numbers cannot be compared across runs. |
| percentilesA | p50/p90/p95/p99 by nearest-rank AND linear interpolation. Warns when n < 100 that p99 is just the maximum wearing a label. |
| collision_probabilityA | Birthday-bound hash collision probability: 1 - exp(-n^2 / (2*2^b)). Sizes hashes: 1e6 items into 64 bits is ~2.7e-8; 1e5 into 32 bits is ~0.69 — the answer to 'can I truncate this to 8 hex chars?' (no). |
| data_sizesC | Byte sizes both ways: binary (KiB/MiB/GiB) AND decimal (KB/MB/GB). The 1024/1000 gap is where '291 MB' and '277 MiB' silently disagree by 5%. |
| human_durationC | Humanised duration plus per-day and per-30d rates. |
| epoch_timeB | Epoch seconds/millis/micros/nanos to ISO 8601 UTC (implausible readings suppressed). |
| base_reprA | hex/oct/bin of N; with WIDTH, two's complement and signed-overflow
detection. |
| radix_convertA | Convert a value between ANY bases 2..36, fractions included; bases that
cannot represent the fraction (e.g. 0.1 in base 2) are flagged
non-terminating. |
| float_reprA | What binary64 actually stores for X: exact value, raw bits, ULP, both
neighbours, and whether the literal is representable. |
| int_widthsA | Which widths (i8..i64/u8..u64) hold N, and the wrapped value where they
do not. Flags anything past 2^53 as unable to round-trip through a JS
number or JSON float. |
| bit_analysisB | popcount, bit length, trailing zeros, power-of-two check, next power of two, and (with align) padding needed to reach an alignment boundary. |
| bitopA | Programmer-mode bit ops: and or xor nand nor xnor not shl shr sar rol ror at width 8/16/32/64. Every result shows unsigned, signed (two's complement), hex, octal and binary. shr is logical (zero-fill); sar is arithmetic (sign-propagating) — 0x80 shr 1 = 0x40 (+64) but 0x80 sar 1 = 0xC0 (-64). A left shift that drops bits says OVERFLOW and shows the unbounded answer. |
| algebraic_equivA | Are two expressions algebraically identical? Refs: 'is (ab)/c the same as a(b/c)?' answered exactly. Caveat: symbolic identity says nothing about float rounding, integer truncation or modular overflow. |
| solve_expressionC | Solve for a root or crossover: 'x**2 - 4 = 0', '2*x + 1 = 7'. |
| limit_expressionA | Asymptotic behaviour: limit of EXPR as var -> point (default oo). 'limit_expression("n*log(n)/n**2", "n")' returns 0 — settles complexity arguments faster than arguing. |
| simplify_expressionC | Simplified, factored and expanded forms of an expression. |
| verify_translationA | PROVE that a port is equivalent: run both programs, compare their output. You write the translation — you are the language model. This runs your source and your port on the same inputs and reports, per input, whether they matched, diverged, or could not be compared (a runtime that is missing or a program that failed on both sides is INCONCLUSIVE, never a pass). Use it after porting anything: python3 -> go, node -> rust, a rewritten function against the original. Pair with compare_edge_cases to find the inputs worth testing. A pass is graded |
| compare_edge_casesA | Run the same logic in N languages on edge-case inputs and flag divergence.
|
| verify_optimizationA | PROVE an optimisation: same outputs, and measurably faster. You write the optimised version. This runs both against the same inputs to
confirm they still agree, then TIMES both at increasing sizes and compares.
Accepted only if equivalent AND at least A rejection tells you which gate failed and by how much — "correct but only 1.09x" is the answer an optimiser that fabricates wins cannot give. A candidate that is faster but wrong fails the first gate, and its speed is never measured, because a faster wrong answer is not an optimisation. An accepted result is graded |
| extract_functionB | Extract a named function (with its imports + referenced helpers) into a standalone program and run it in the sandbox. python3 gets exact ast extraction; other languages best-effort block
extraction (pass |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/The-40-Thieves/codecalc'
If you have feedback or need assistance with the MCP directory API, please join our Discord server