Tact — 132 Operations for AI Agents
Tact contracts run on TON, where message-passing and gas discipline shape every design. act101 gives agents the contract's receivers, getters, and structs as a map, so on-chain logic stays navigable.
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze Tact code through the act MCP server. 132 operations available: 58 refactor, 18 query, 42 analysis, 14 verification. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
Premium language. Operations on Tact require an Elite license or above. See pricing.
Worked Tact examples
act101 parses Tact with the tree-sitter grammar and edits contracts, structs, and messages as syntax nodes, so a modifier change or a field addition lands on the exact declaration it targets. It can turn a plain function into an externally-readable getter by adding the get modifier. It can add a new field to an existing struct, contract, or message body. And it can extract a chosen subset of a struct's fields into a new nested struct, replacing them in the original with a single field of the new type. Each example below is the verbatim output of the command shown, run against the file shown.
Convert a function to a getter
balance.tact declares balance as a plain function.
$ act refactor-lang convert_to_getter --file balance.tact --params '{"function_name":"balance","line":1,"column":1}'
Before
fun balance(): Int { 100 }
After
get fun balance(): Int { 100 }
get is inserted before fun, making balance externally readable.
Add a field to a struct
point.tact's Point struct has x and y fields.
$ act refactor-lang add_field --file point.tact --params '{"container_name":"Point","field_name":"z","field_type":"Int","line":1,"column":1}'
Before
struct Point { x: Int; y: Int; }
After
struct Point { x: Int; y: Int; z: Int; }
A z: Int field is appended to Point's field list.
Extract fields into a nested struct
account.tact's Account struct mixes an identity field (owner), a mutable counter (nonce), and a balance in one flat declaration.
$ act refactor-lang extract_struct --file account.tact --params '{"struct_name":"Account","new_struct_name":"AccountMeta","new_field_name":"meta","field_names":["owner","nonce"],"line":1,"column":1}'
Before
struct Account { owner: Address; balance: Int; nonce: Int; }
After
struct AccountMeta { owner: Address; nonce: Int; }
struct Account { meta: AccountMeta; balance: Int; }
owner and nonce move into a new AccountMeta struct; Account keeps balance and gains a single meta: AccountMeta field in their place.
Query
18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.
callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch
Refactor
| Operation | Description |
|---|---|
add-bounced-handler |
Insert a bounced handler for a message into a Tact contract body. |
add-constant |
Add a top-level Tact constant declaration. |
add-field |
Add a field to a Tact struct/contract/message body. |
add-gas-check |
Insert an acceptMessage() gas-acceptance call at the start of a Tact function body. |
add-init-parameter |
Add a parameter to a Tact contract's init signature and a matching self-assignment, creating init if absent. |
add-opcode-annotation |
Add or update the message(opcode) annotation on a Tact message type. |
add-receiver |
Insert a receive handler for a message into a Tact contract body. |
change-opcode |
Change an existing message opcode value on a Tact message type. |
convert-getter-to-internal |
Convert a Tact getter function back to internal by removing the get modifier. |
convert-map-to-structs |
Replace a Tact map<K,V> field with a struct-typed field. |
convert-message-to-struct |
Convert a Tact message into a struct by dropping the opcode and changing the keyword. |
convert-send-parameters-to-builder |
Introduce a beginCell()-constructed body field into a Tact SendParameters instance inside a send() call. |
convert-struct-to-message |
Convert a Tact struct into a message by inserting an opcode and changing the keyword. |
convert-to-getter |
Convert a Tact function into an externally-readable getter by adding the get modifier. |
convert-to-map |
Convert named Tact struct fields into a single map<K,V> field. |
convert-to-mixin |
Compose a named Tact trait into the first contract via the with clause. |
extract-function |
Extract selected Tact lines into a new function and replace them with a call. |
extract-mixin |
Move named Tact top-level functions into a newly-created trait. |
extract-struct |
Extract selected fields from a Tact struct into a new nested struct. |
extract-to-contract |
Move named top-level Tact declarations (struct/message/const/function) into a new contract body. |
extract-to-trait |
Extract selected Tact functions' declarations into a new top-level trait. |
extract_function |
Extract a code selection into a new function — automatically infers parameters, return types, and inserts the call site. Use instead of manually cutting/pasting code. Works without LSP; LSP improves type inference. Params: file (string), new_name (string), start_line (u32), start_column (u32), end_line (u32), end_column (u32) [, preview (bool), receipt (bool)] |
extract_variable |
Extract an expression into a named variable — inserts the declaration and replaces the expression with the variable name. Works without LSP. Params: file (string), new_name (string), start_line (u32), start_column (u32), end_line (u32), end_column (u32) [, preview (bool)] |
fix-bounced-handler-signature |
Correct a Tact contract's bounced() parameter type to a given message type. |
fix-gas-limit-exceeded |
Insert an acceptMessage() gas-acceptance call at the start of a Tact function body. |
fix-invalid-message-opcode |
Set a valid opcode on a Tact message type (add or replace message_value). |
fix-missing-init |
Add an init() to a Tact contract initializing its uninitialized storage fields. |
fix-uninitialized-field |
Initialize a Tact contract's uninitialized storage field in init(). |
gen-contract-scaffold |
Generate a minimal Tact contract scaffold (init/receive/getter stubs). |
gen-deployment-script |
Generate a minimal Tact deployment scaffold contract (Tact has no native deploy syntax). |
gen-dex-pool-contract |
Generate a minimal Tact DEX pool contract scaffold. |
gen-getter-function |
Generate a Tact get-function stub wrapped in a contract. |
gen-jetton-contract |
Generate a minimal Tact Jetton minter scaffold (not TEP-74 complete). |
gen-message-definition |
Generate a Tact message(opcode) type definition scaffold. |
gen-multisig-contract |
Generate a minimal Tact multisig wallet scaffold. |
gen-nft-contract |
Generate a minimal Tact NFT collection scaffold (not TEP-62 complete). |
gen-receiver-function |
Generate a Tact receive() handler stub for a message, wrapped in a contract. |
gen-test-scaffold |
Generate a minimal Tact test scaffold contract (Tact has no native test syntax). |
inline |
Inline a variable, function, or method — replace every usage with its definition body, then remove the original. The inverse of extract. Works without LSP (single-file); LSP enables cross-file inlining. Params: file (string), symbol (string) [, line (u32), preview (bool), receipt (bool)] |
inline-function |
Inline a simple single-expression Tact function at its same-file call sites. |
inline-struct |
Inline a single-use Tact struct's fields into its parent struct. |
inline-trait |
Inline a Tact trait's member functions to top level and remove the trait declaration. |
insert_body |
Replace a function's implementation body with new code. AST-validated — rejects if the result has parse errors, so you can't accidentally break syntax. Use instead of manual text editing for function rewrites. Params: file (string), symbol (string), code (string) [, commit (bool)] |
move_symbol |
Move a function, class, or type to a different file and automatically update all imports across the codebase. Use instead of manually cut/paste + fixing imports. Works without LSP (single-file); LSP enables cross-file import updates. Params: file (string), symbol (string), destination (string) [, preview (bool), receipt (bool)] |
recipe_run |
Run a codemod recipe: declarative match → transform → optional verify across modeled grammars. Preview lists matches; apply writes with optional E7 receipts and all-or-nothing rollback. Returns a per-site report. |
remove-bounced-handler |
Remove the bounced handler for a message from a Tact contract. |
remove-constant |
Remove a top-level Tact constant and substitute same-file references with its value. |
remove-field |
Remove an unused field from a Tact struct/contract/message body. |
remove-gas-check |
Remove an acceptMessage() gas-acceptance call from a Tact function body. |
remove-init-parameter |
Remove a parameter from a Tact contract's init signature and its matching self-assignment. |
remove-receiver |
Remove the receive handler for a message from a Tact contract. |
rename |
Rename a symbol and automatically update ALL references across the codebase. Safer and faster than find-and-replace — AST-aware, won't rename strings or comments. Works without LSP (single-file); LSP enables cross-file renames. Params: file (string), old_name (string), new_name (string) [, line (u32), column (u32), preview (bool), receipt (bool)] |
rename-contract |
Rename a Tact contract and same-file references. |
rename-field |
Rename a Tact struct/contract/message field and same-file access/instance sites. |
rename-function |
Rename a Tact function and same-file direct call sites. |
rename-message |
Rename a Tact message and same-file type/constructor references. |
rename-struct |
Rename a Tact struct and same-file type/constructor references. |
reorder-fields |
Reorder the fields of a Tact struct/contract/message into a new order. |
Analysis
42 analysis tools, the same on every supported language. Descriptions live in the shared reference: /docs/analysis-tools.
analyze_api_diff analyze_chokepoints analyze_clones analyze_clusters analyze_cohesion analyze_conformance analyze_coupling analyze_cycle_risk analyze_cycles analyze_dead_code analyze_depth analyze_entry_points analyze_export analyze_extraction analyze_fan_balance analyze_features analyze_hotspots analyze_impact analyze_inconsistencies analyze_inheritance analyze_interface_bloat analyze_interfaces analyze_layers analyze_orphan_types analyze_patterns analyze_platform_deps analyze_readiness analyze_roles analyze_seams analyze_stability analyze_surface analyze_test_gaps analyze_thickness analyze_type_completeness churn_hotspots co_change_clusters coverage_overlay ownership_map profile_overlay simulate split_module trace_overlay
Verify
14 verify tools, the same on every supported language. Descriptions live in the shared reference: /docs/verification.
bisect_regression gate generate_test_harness scan secret_surface summarize_pr taint_flow unsafe_surface verify_behavioral_equivalence verify_contract_preserved verify_diff_semantics verify_port_parity verify_side_effects verify_test_impact