get_compiler_version
Check the available Tolk compiler version for TON blockchain smart contracts to verify compatibility before development.
Instructions
Returns the version of the Tolk compiler (from @ton/tolk-js WASM). Use this to check which compiler version is available.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:50-68 (handler)The handler function for get_compiler_version that calls getTolkCompilerVersion() from @ton/tolk-js and returns the Tolk compiler version as text, with error handling
server.tool( "get_compiler_version", "Returns the version of the Tolk compiler (from @ton/tolk-js WASM). " + "Use this to check which compiler version is available.", {}, async () => { try { const version = await getTolkCompilerVersion(); return { content: [{ type: "text", text: `Tolk compiler version: ${version}` }], }; } catch (err: any) { return { content: [{ type: "text", text: `Failed to get compiler version: ${err.message}` }], isError: true, }; } }, ); - src/tools.ts:50-68 (registration)Tool registration with server.tool() that registers get_compiler_version with its name, description, and handler
server.tool( "get_compiler_version", "Returns the version of the Tolk compiler (from @ton/tolk-js WASM). " + "Use this to check which compiler version is available.", {}, async () => { try { const version = await getTolkCompilerVersion(); return { content: [{ type: "text", text: `Tolk compiler version: ${version}` }], }; } catch (err: any) { return { content: [{ type: "text", text: `Failed to get compiler version: ${err.message}` }], isError: true, }; } }, ); - src/tools.ts:54-54 (schema)Input schema definition - empty object indicates the tool takes no input parameters
{}, - src/tools.ts:3-3 (helper)Import of getTolkCompilerVersion function from @ton/tolk-js library used by the handler
import { getTolkCompilerVersion, runTolkCompiler } from "@ton/tolk-js"; - src/index.ts:26-26 (registration)Main entry point that calls registerTools to register all tools including get_compiler_version
registerTools(server);