Skip to content
AI & MCP / MCP tools

MCP tools

Markdown

Parameters, results and example calls for the four Atracode MCP tools, plus how refusals and divergences come back.

Preview. Atracode opens at launch, and the commands, tools and API shapes on this page may change before then.

The MCP server gives your agent four tools. Each takes JSON arguments and returns a JSON result. This page lists the parameters and result shapes for the preview; names and fields may change before launch.

ToolWhat it does
atracode_compileCompiles source to a SEG and returns its RAVEN hash, or a located refusal
atracode_verify_equivalenceChecks whether two programs, in any languages, have the same behavior
atracode_inspect_segShows a compiled SEG’s inputs, membrane reads and writes, and bounds
atracode_get_raven_hashReturns a program’s RAVEN hash only

Every tool that takes code accepts either source (the program text) or path (a file the agent can read). Give one, not both. When you pass source, add language so the compiler knows which front end to use; with path, the language is inferred from the file name. Each call that compiles a program counts as one compilation against your workspace quota.

atracode_compile

Compiles a program in any supported language.

ParameterTypeRequiredDescription
sourcestringOne of source or pathProgram text
pathstringOne of source or pathPath to a source file
languagestringNoFront end to use. Inferred from the file name when omitted

Result:

FieldTypeDescription
status"verified" or "refused"Outcome of the compile
raven_hashstring64 hex characters. Present when status is "verified"
refusalobject{ file, line, column, reason, hint }. Present when status is "refused"

Example call:

{ "name": "atracode_compile", "arguments": { "path": "interest.py" } }

Verified result:

{
  "status": "verified",
  "raven_hash": "13803fe6908d64b3301b931688e6244c99d9b80f15c781f5de7581abb7c3d2af"
}

Refused result:

{
  "status": "refused",
  "refusal": {
    "file": "rotate.sh",
    "line": 12,
    "column": 9,
    "reason": "reads $(date), which differs on every run",
    "hint": "pass the timestamp in as an argument and compile again"
  }
}

atracode_verify_equivalence

Compiles two programs and checks whether they compute the same thing. They can be in the same language or in different ones.

ParameterTypeRequiredDescription
aobjectYes{ source or path, language? } for the first program
bobjectYes{ source or path, language? } for the second program

Result:

FieldTypeDescription
identicalbooleantrue when both programs have the same behavior
raven_astringRAVEN hash of a
raven_bstringRAVEN hash of b
divergenceobject{ input, output_a, output_b }. Present when identical is false

Example call:

{
  "name": "atracode_verify_equivalence",
  "arguments": {
    "a": { "path": "INTEREST.cbl" },
    "b": { "path": "interest.rs" }
  }
}

Result when the programs differ:

{
  "identical": false,
  "raven_a": "13803fe6908d64b3301b931688e6244c99d9b80f15c781f5de7581abb7c3d2af",
  "raven_b": "9c41e07b52aa0f6e3d19c8b4407f2e15a6d0b93e7c58124f0e6ab3d9f1c27e85",
  "divergence": {
    "input": { "balance": 200, "rate_bp": 25, "years": 1 },
    "output_a": 201,
    "output_b": 200
  }
}

When identical is true, raven_a and raven_b are equal and there is no divergence.

atracode_inspect_seg

Shows the structure of a compiled SEG. Pass a raven_hash from an earlier compile, or source or path to compile and inspect in one step.

ParameterTypeRequiredDescription
raven_hashstringOne of raven_hash, source or pathHash of a program you have compiled
sourcestringOne of the threeProgram text
pathstringOne of the threePath to a source file
languagestringNoFront end to use with source or path

Result:

FieldTypeDescription
inputsarrayThe values the program takes in
membrane.readsarrayEvery read through the memory membrane
membrane.writesarrayEvery write through the memory membrane
bounds.fuelnumberThe fuel budget for one execution
bounds.widthsobjectInteger widths fixed at compile time

Example call:

{ "name": "atracode_inspect_seg", "arguments": { "path": "rotate.sh" } }

Result:

{
  "inputs": ["timestamp", "log_dir"],
  "membrane": {
    "reads": ["log_dir/app.log"],
    "writes": ["log_dir/app.log.1"]
  },
  "bounds": {
    "fuel": 50000,
    "widths": { "timestamp": "i64" }
  }
}

atracode_get_raven_hash

Returns the RAVEN hash and nothing else. Use it for caching, provenance and audit, when you only need the identity.

ParameterTypeRequiredDescription
sourcestringOne of source or pathProgram text
pathstringOne of source or pathPath to a source file
languagestringNoFront end to use. Inferred from the file name when omitted

Example call:

{ "name": "atracode_get_raven_hash", "arguments": { "source": "def f(x):\n    return x * 2\n", "language": "python" } }

Result:

{ "raven_hash": "2ce06a9e7f8c3e6bf85a6067d0b220fb0ad03de983053942a90c43e73ec76f89" }

Refusals and divergences

Both come back as ordinary results, not as tool errors:

  • A refusal is "status": "refused" with a refusal object. The compiler stopped at the exact file, line and column of a construct it cannot verify, and hint says how to fix it. Your agent should apply the hint and call the tool again.
  • A divergence is "identical": false with a divergence object. input is a concrete input on which the two programs disagree, and output_a and output_b are what each one produced. Your agent can run that input itself to reproduce the difference.

Tool errors are reserved for calls that could not run at all: a missing or rejected API key, an exhausted quota, invalid arguments, or the service being unavailable. Errors describes each one.

Tip: Tell your agent in its instructions that a refusal is feedback to act on, so it fixes the code instead of retrying the same call.

Next steps

  • MCP server Install and configure the server
  • Refusals Common refusal reasons and fixes
  • RAVEN What the hash identifies
  • Errors Failures that are not refusals
esc

Type to search titles, headings and text.