Skip to main content
Glama

runTolkCompiler

Compile Tolk smart contract source code for the TON blockchain and receive generated Fift assembler code, bytecode BOC, and code hash, or a detailed compilation error.

Instructions

Compiles Tolk source code and returns the compilation result.

On success, returns:

  • fiftCode: Generated Fift assembler code

  • codeBoc64: Base64-encoded BOC (Bag of Cells) containing the compiled contract

  • codeHashHex: Hexadecimal hash of the compiled code

  • stderr: Any compiler warnings

On error, returns:

  • status: "error"

  • message: Description of the compilation error

Use this tool to verify that Tolk code compiles correctly and to obtain the compiled bytecode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourcesYesA map of filename to source code content. Must include the entrypoint file and any imported files.
optimizationLevelNoOptimization level for the compiler (0-2). Default is 2. Higher levels produce more optimized code.
withStackCommentsNoInclude stack annotations in the generated Fift output. Default is false.
entrypointFileNameYesThe name of the main .tolk file to compile
experimentalOptionsNoExperimental compiler flags (space-separated)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses success and error return structures in detail (fiftCode, codeBoc64, codeHashHex, stderr; status and message on error), which is more than most. It does not mention side effects, but compilation is a pure operation; it also omits permission or rate-limit context, which is acceptable for a compiler tool.

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?

The description is well-organized with clear sections for success and error outputs, and the primary purpose is stated up front. It is slightly verbose but every sentence contributes to understanding the tool's behavior and outputs, avoiding fluff.

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?

The tool has five parameters, one nested object, and no output schema; the description compensates by explicitly listing return fields and error structure. It does not describe parameter semantics (covered by schema) or limitations like file size caps, but overall it provides enough context for an agent to call the tool correctly.

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 100%, so all five parameters are documented in the schema itself. The description adds no extra parameter-level detail beyond what the schema already provides. Per the rubric, the baseline is 3 when schema coverage is high, and no additional value is offered.

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

Purpose5/5

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

The description opens with a specific verb and resource: 'Compiles Tolk source code and returns the compilation result.' It clearly differentiates from the sibling tool getTolkCompilerVersion, which is about version retrieval. The scope is unambiguous.

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?

The description ends with 'Use this tool to verify that Tolk code compiles correctly and to obtain the compiled bytecode,' providing a clear when-to-use statement. It doesn't explicitly mention exclusions or the sibling tool, but the sibling's purpose is distinct enough that no confusion is likely.

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

Deploy Server

Other Tools