Skip to main content
Glama

get-transaction

Retrieve blockchain transaction details using transaction hashes or chain identifiers to verify and analyze on-chain activity through secure wallet integration.

Instructions

Get the transactions given hashes or chain identifiers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYes
chainIdNo

Implementation Reference

  • Handler function that retrieves the transaction using wagmi's getTransaction based on hash and optional chainId, then returns it as JSON stringified text content.
    execute: async (args) => {
      const hash = args.hash as Address
      const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
      const result = await getTransaction(wagmiConfig, {
        hash,
        chainId,
      })
      return {
        content: [
          {
            type: "text",
            text: JSONStringify(result),
          },
        ],
      }
    },
  • Zod schema defining the input parameters: hash (string) and optional chainId (number).
    parameters: z.object({
      hash: z.string(),
      chainId: z.coerce.number().optional(),
    }),
  • Registers the get-transaction tool on the FastMCP server instance.
    registerGetTransactionTools(server);

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