Skip to main content
Glama

call

Execute message calls to blockchain contracts directly without submitting transactions, enabling secure testing and interaction through MetaMask wallet integration.

Instructions

Executing a new message call immediately without submitting a transaction to the network

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
valueNo
dataYes

Implementation Reference

  • Handler function that executes the low-level 'call' action using wagmi/core's call, casting arguments, handling TransactionExecutionError and generic errors, returning JSON-stringified result or error message.
    execute: async (args) => {
      try {
        const to = args.to as Address
        const value = args.value ? BigInt(args.value) : undefined
        const data = args.data as Address
        const result = await call(wagmiConfig, {
          to,
          value,
          data,
        })
        return {
          content: [
            {
              type: "text",
              text: JSONStringify({
                hash: result
              }),
            },
          ],
        }
      } catch (error) {
        if (error instanceof TransactionExecutionError) {
          return {
            content: [
              {
                type: "text",
                text: error.cause.message,
              }
            ]
          }
        }
        return {
          content: [
            {
              type: "text",
              text: (error as Error).message,
            }
          ]
        }
      }
    },
  • Zod input schema for the 'call' tool defining parameters: to (string address), optional value (number coerced to bigint), data (string calldata).
    parameters: z.object({
      to: z.string(),
      value: z.coerce.number().optional(),
      data: z.string(),
    }),
  • Core registration of the 'call' tool on the FastMCP server within registerCallTools, including name, description, schema, and handler.
    server.addTool({
      name: "call",
      description: "Executing a new message call immediately without submitting a transaction to the network",
      parameters: z.object({
        to: z.string(),
        value: z.coerce.number().optional(),
        data: z.string(),
      }),
      execute: async (args) => {
        try {
          const to = args.to as Address
          const value = args.value ? BigInt(args.value) : undefined
          const data = args.data as Address
          const result = await call(wagmiConfig, {
            to,
            value,
            data,
          })
          return {
            content: [
              {
                type: "text",
                text: JSONStringify({
                  hash: result
                }),
              },
            ],
          }
        } catch (error) {
          if (error instanceof TransactionExecutionError) {
            return {
              content: [
                {
                  type: "text",
                  text: error.cause.message,
                }
              ]
            }
          }
          return {
            content: [
              {
                type: "text",
                text: (error as Error).message,
              }
            ]
          }
        }
      },
    });
  • Invocation of the registerCallTools function on the main FastMCP server instance to register the 'call' tool.
    registerCallTools(server);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'immediately without submitting a transaction', which hints at non-destructive, simulation-like behavior, but fails to detail critical aspects such as whether it requires authentication, has rate limits, returns specific data formats, or what happens on errors. This leaves significant gaps in understanding the tool's operational traits.

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 a single, efficient sentence that front-loads the key information ('Executing a new message call') and adds necessary context ('immediately without submitting a transaction'). There is no wasted text, making it highly concise and well-structured.

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?

Given the complexity of blockchain operations, no annotations, no output schema, and 0% schema coverage, the description is incomplete. It lacks details on parameters, behavioral constraints, return values, and error handling, which are essential for an agent to use this tool effectively in a context with many sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate by explaining parameters, but it provides no information about 'to', 'value', or 'data'. This leaves all three parameters undocumented, making it difficult for an agent to understand their purpose or usage beyond the basic schema types.

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?

The description clearly states the action ('Executing a new message call') and distinguishes it from submitting a transaction, which differentiates it from sibling tools like 'send-transaction' and 'write-contract'. However, it doesn't explicitly name the resource being acted upon (e.g., a smart contract or blockchain), making it slightly less specific than a perfect score.

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 implies usage for immediate execution without network submission, suggesting it's for read-only or simulation purposes versus transactional siblings. However, it lacks explicit guidance on when to use this tool over alternatives like 'read-contract' or 'send-transaction', leaving some ambiguity for the agent.

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/Xiawpohr/mcpilot'

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