Skip to main content
Glama

compile_tolk

Compile Tolk smart contract source code to Fift and BoC format. Provide source files as a filename-content map with an entrypoint; standard library imports resolved automatically.

Instructions

Compiles Tolk smart contract source code using @ton/tolk-js. Provide source files as a map of filename->content. The entrypoint file must be included. Standard library imports (@stdlib/, @fiftlib/) are resolved automatically. Supports pathMappings for custom @alias import resolution. Returns compiled Fift code, BoC (Bag of Cells) in base64, code hash, and compiler version.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entrypointFileNameYesThe main .tolk file to compile (e.g., "main.tolk")
sourcesYesObject mapping filename -> source code content. Must include the entrypoint file. Example: {"main.tolk": "fun main(): int { return 0; }"}
optimizationLevelNoOptimization level 0-2 (default: 2)
withStackCommentsNoInclude stack layout comments in Fift output
pathMappingsNoMaps @alias prefixes to absolute folder paths for import resolution. Example: {"@mylib": "/path/to/mylib"}
Behavior3/5

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

No annotations provided, so description carries the burden. It discloses that compilation uses @ton/tolk-js, resolves standard libraries automatically, and returns specific outputs. However, it does not mention error handling, permissions, or potential side effects, leaving gaps in transparency.

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?

Description is a single efficient paragraph covering all key aspects without redundancy. It is front-loaded with the main action and includes necessary details. Minor improvement could be structuring bullet points for readability.

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?

Given the complexity (5 params, nested objects, no output schema), the description adequately explains inputs and outputs, including automatic library resolution. It lacks details on output format expectations and error scenarios, but is sufficient for an agent to understand the tool's purpose and basic usage.

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 coverage is 100%, so the schema already explains parameters. The description adds value by summarizing output and clarifying automatic library resolution and pathMappings usage. This extra context is helpful but not extensive, so a baseline 3 is appropriate.

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 clearly states the tool compiles Tolk smart contract source code using @ton/tolk-js, specifying inputs (source map, entrypoint) and outputs (Fift code, BoC, code hash, compiler version). It distinguishes from siblings by focusing on compilation vs syntax checking or deploy link generation.

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

Usage Guidelines3/5

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

The description explains how to provide sources but lacks explicit when-to-use guidance or alternatives. It does not mention when to use check_tolk_syntax first or what constraints exist. The usage context is implied but not differentiated.

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

Install Server

Other Tools

Latest Blog Posts

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/izzzzzi/izTolkMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server