Skip to main content
Glama

invoke_contract

Simulate a Soroban contract function call over RPC to get the result and resource costs (CPU, memory, min fee) without needing signing for read-only calls.

Instructions

Simulates a Soroban contract function call via RPC. Returns the function result AND simulated resource cost (CPU instructions, memory, min fee). For read-only calls no signing is needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoArguments to pass to the function. Supported types: number, string, boolean, or objects with {type: "address"|"bytes", value: string}
networkNoNetwork to invoke ontestnet
contract_idYesContract ID (56-character string starting with C)
function_nameYesName of the contract function to call
source_accountNoSource account public key for simulation (not required for read-only calls). Defaults to a zero-balance account for simulation.
Behavior4/5

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

With no annotations, the description carries the transparency burden. It discloses key behaviors: simulation via RPC, return of function result and resource costs (CPU, memory, min fee), and signing only needed for non-read-only calls. This goes beyond a simple 'invokes a function' and addresses important operational aspects, though it does not explicitly rule out on-chain side effects or detail error handling.

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?

The description is two sentences, front-loaded with the central purpose, and every clause earns its place. It efficiently communicates the simulation nature, return value composition, and a key usage condition without redundancy.

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?

For a simulation tool with no output schema, the description sufficiently explains what the tool returns and the signing context. However, it omits prerequisites such as the contract being deployed or the need for a network connection, and it could clarify that simulation does not submit an on-chain transaction. These gaps prevent a perfect score.

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 input schema fully documents each parameter. The description adds minimal parameter-specific meaning beyond mentioning signing in the context of read-only calls, which is also covered by the source_account parameter description. At the baseline for full schema coverage, this score 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 uses a specific verb ('Simulates') and resource ('Soroban contract function call via RPC'), making the tool's purpose immediately clear. It distinguishes from siblings like deploy_contract or get_contract_state by focusing on function invocation simulation, not deployment or direct state reads.

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

Usage Guidelines4/5

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

The description provides clear context that this is a simulation, not actual execution, and notes the signing requirement for read-only calls. However, it offers no explicit comparison to alternatives (e.g., when to use get_contract_state instead) or exclusions, so it slightly misses the highest bar.

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/firstJOASH/soroban-mcp-server'

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