Skip to main content
Glama

broadcastTransaction

Submit signed blockchain transactions to execute operations like transfers, staking, and token conversions across multiple networks.

Instructions

Broadcast a signed transaction. You will probably need another MCP server dedicated in key management and signing before using this.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdYes
bodyYes

Implementation Reference

  • The handler function that executes the broadcastTransaction tool logic. It sends the signed transaction (in body) to the Adamik API broadcast endpoint via POST request and returns the JSON response as MCP content.
    async ({ chainId, body, }: BroadcastTransactionPathParams & { body: BroadcastTransactionRequestBody; }) => { const result = await makeApiRequest<BroadcastTransactionResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/transaction/broadcast`, ADAMIK_API_KEY, "POST", JSON.stringify(body) ); const text = JSON.stringify(result); return { content: [ { type: "text", text, }, ], }; }
  • Zod schema definitions for the broadcastTransaction tool, including path parameters (chainId), request body structure (transaction data from encode, encoded items, signature), and response (chainId, optional hash).
    export const BroadcastTransactionPathParamsSchema = z.object({ chainId: ChainIdSchema, }); export type BroadcastTransactionPathParams = z.infer<typeof BroadcastTransactionPathParamsSchema>; export const BroadcastTransactionRequestBodyTransactionSchema = z.object({ data: EncodeTransactionResponseDataSchema, // Data from encode response encoded: z.array(EncodedItemSchema), // Encoded from encode response signature: z.string(), }); export const BroadcastTransactionRequestBodySchema = z.object({ transaction: BroadcastTransactionRequestBodyTransactionSchema, }); export type BroadcastTransactionRequestBody = z.infer<typeof BroadcastTransactionRequestBodySchema>; export const BroadcastTransactionResponseSchema = z.object({ chainId: ChainIdSchema, hash: z.string().optional(), }); export type BroadcastTransactionResponse = z.infer<typeof BroadcastTransactionResponseSchema>;
  • src/module.ts:470-479 (registration)
    MCP server tool registration for 'broadcastTransaction', providing the tool name, description, and input schema (chainId and body using imported schemas).
    server.tool( "broadcastTransaction", [ "Broadcast a signed transaction. You will probably need another MCP server dedicated in key management and signing", "before using this.", ].join(" "), { chainId: ChainIdSchema, body: BroadcastTransactionRequestBodySchema, },

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/AdamikHQ/adamik-mcp-server'

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