Skip to main content
Glama

write_contract

Destructive

Execute state-changing functions on a TRON smart contract with a configured wallet. Call contract methods, pass arguments, and send TRX value to write transactions on mainnet or other networks.

Instructions

Execute state-changing functions on a smart contract. Requires configured wallet.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "contractAddress": "<contractAddress>",
      "functionName": "<functionName>"
    },
    "name": "write_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
abiNoOptional contract ABI array. If not provided, will fetch from chain. Use for contracts with incomplete on-chain ABI.
argsNoFunction arguments (supports arrays and objects for complex types)
valueNoTRX value to send (in Sun)
networkNoNetwork name. Defaults to mainnet.
functionNameYesFunction name to call
contractAddressYesThe contract address

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / abi / items / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / args / items / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "items": {
      -      "type": "number"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "additionalProperties": {},
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "items": {
      +      "type": "number"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  }
      +]
  2. First observedv1.1.7

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, idempotentHint=false and openWorldHint=true. The description adds one genuinely useful piece of context not in the annotations, the 'Requires configured wallet' prerequisite, but says nothing about irreversibility, energy/TRX cost, or confirmation behaviour that matter for a destructive write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with zero waste; the action is front-loaded and the prerequisite follows. Nothing could be removed without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Annotations carry the safety profile, but with six parameters, no output schema, and no mention of what a successful call yields (e.g. a transaction hash) or how errors surface, the definition leaves the agent guessing about outcomes for a destructive operation.

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 every parameter including abi, args, value and network is already documented in the schema. The description adds no meaning beyond it, which is the expected baseline when the schema does the heavy lifting.

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

Purpose4/5

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

States a specific verb and resource: 'Execute state-changing functions on a smart contract'. The word 'state-changing' implicitly contrasts with a read path, so an agent can distinguish it from read_contract, though no sibling is named explicitly.

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 phrase 'state-changing functions' implies when to use it versus a read, but there is no explicit guidance such as 'use read_contract for view functions' or 'use deploy_contract to create a new contract'. Usage is inferable but not spelled out.

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