Skip to main content
Glama

write_contract

Sign and broadcast a call to a state-changing contract method. Invoke contract functions by providing address, ABI, method, arguments, and optional native value.

Instructions

Sign and broadcast a call to a state-changing contract method. Provide address, ABI fragments, method, args, and optional native value. STATE-CHANGING.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
abiYesHuman-readable ABI fragments.
argsNoPositional arguments.
valueNoOptional native value to send with the call (native units).
methodYesMethod name to invoke.
addressYesContract address.
networkNoTarget network. One of: ethereum, base, arbitrum, optimism, polygon, sepolia, base-sepolia, arbitrum-sepolia, optimism-sepolia, polygon-amoy. Defaults to the server's configured default network.
Behavior2/5

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

With no annotations, the description must fully convey behavioral traits. It notes 'STATE-CHANGING' and 'broadcast', but omits critical details such as gas costs, balance requirements, nonce handling, error behavior, return value, or transaction finality. This is insufficient for a mutation tool.

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 concise sentences, front-loaded with the core action and key inputs. No redundant information. Every sentence contributes to clarity.

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

Completeness2/5

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

Despite good parameter coverage in the schema, the description lacks essential contextual details for a transaction tool: no mention of the return type (likely transaction hash), gas implications, prerequisites, or potential reverts. An agent would be under-informed about the tool's full behavior and risks.

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?

The schema covers all 6 parameters with descriptions (100% coverage). The description merely lists parameter names without adding meaning beyond the schema, so it meets the baseline but provides no extra semantic value.

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 action ('Sign and broadcast a call') and the resource ('state-changing contract method'), explicitly listing key parameters. The 'STATE-CHANGING' emphasis and contrast with siblings like 'read_contract' make the purpose unambiguous.

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 provides a basic usage hint ('Provide address, ABI fragments, method, args, and optional native value') but does not explicitly state when to use this tool versus alternatives like 'simulate_transaction' or 'send_native'. No exclusions or conditional guidance is given.

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/vkpatva/crypto-mcp'

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