Skip to main content
Glama

send-transaction

Execute blockchain transactions by specifying recipient addresses, values, and data payloads to interact securely with decentralized networks.

Instructions

Send transactions to networks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
valueNo
dataNo

Implementation Reference

  • The execute handler for the 'send-transaction' tool. It sends a transaction using wagmi/core's sendTransaction with parameters to, value (optional), data (optional). Returns the transaction hash in JSON or an error message in MCP content format, handling TransactionExecutionError specifically.
    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 sendTransaction(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 defining the parameters for the send-transaction tool: 'to' (required string), 'value' (optional coercible number), 'data' (optional string).
    parameters: z.object({
      to: z.string(),
      value: z.coerce.number().optional(),
      data: z.string().optional(),
    }),
  • The registration function that defines and adds the 'send-transaction' tool to the FastMCP server instance, including name, description, schema, and handler.
    export function registerSendTransactionTools(server: FastMCP): void {
      server.addTool({
        name: "send-transaction",
        description: "Send transactions to networks",
        parameters: z.object({
          to: z.string(),
          value: z.coerce.number().optional(),
          data: z.string().optional(),
        }),
        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 sendTransaction(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 registerSendTransactionTools function during server initialization to register the tool on the main FastMCP server.
    registerSendTransactionTools(server);
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action without detailing critical traits like required permissions, network effects, confirmation times, error handling, or whether it's destructive. This is inadequate for a transaction-sending tool with zero annotation coverage.

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 extremely concise with a single sentence, 'Send transactions to networks', which is front-loaded and wastes no words. However, this brevity comes at the cost of under-specification, but for conciseness alone, it scores high.

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

Completeness1/5

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

Given the complexity of sending transactions, lack of annotations, 0% schema coverage, no output schema, and multiple sibling tools, the description is severely incomplete. It omits essential details like network targeting, transaction lifecycle, error scenarios, and return values, making it inadequate for safe and effective use.

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

Parameters1/5

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

Schema description coverage is 0%, meaning parameters 'to', 'value', and 'data' are undocumented in the schema. The description adds no information about these parameters, such as what 'to' represents (e.g., address format), what 'value' units are (e.g., wei), or what 'data' contains (e.g., encoded call data). It fails to compensate for the schema gap.

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

Purpose2/5

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

The description 'Send transactions to networks' restates the tool name 'send-transaction' with minimal elaboration, making it tautological. It specifies the action (send) and target (transactions to networks) but lacks specificity about what kind of transactions or which networks, failing to distinguish it from sibling tools like 'write-contract' or 'call'.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. With siblings like 'write-contract', 'call', and 'sign-message' that involve transaction-related operations, the description offers no context, prerequisites, or exclusions, leaving the agent without direction.

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