Skip to main content
Glama

GET_TRANSACTION

Retrieve transaction details from the OpenOcean MCP server to verify swap status and confirm blockchain execution using the transaction hash.

Instructions

Get Transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoThe blockchain network to execute the transaction on. uses fraxtal as defaultfraxtal
hashYesHash from the OpenOcean contract on the blockchain.

Implementation Reference

  • The handler function that executes the GET_TRANSACTION tool logic. Resolves chain, fetches transaction via ChainService, returns JSON or error.
    export const getTransaction = async (args: z.infer<typeof hashParamsSchema>) => { try { const inputChain = args.chain.toLowerCase(); const chainObject = getChainFromName(inputChain); console.error(`[GET_TRANSACTION] Using chain: ${chainObject.name}`, args); const service = new ChainService(); const tx = await service.getTransaction(chainObject.id, args.hash); if (tx instanceof Error) { return `Error fetching getTransaction: ${tx.message}`; } return JSON.stringify(tx, null, 2); } catch (error: unknown) { const message = error instanceof Error ? error.message : "An unknown error occurred while fetching getTransaction."; console.error(`[GET_TRANSACTION] Error: ${message}`); throw new Error(`Failed to fetch getTransaction: ${message}`); } }
  • Zod input schema for GET_TRANSACTION tool: chain (optional string, default 'fraxtal'), hash (validated transaction hash string).
    export const hashParamsSchema = z.object({ chain: z .string() .optional() .describe( "The blockchain network to execute the transaction on. uses fraxtal as default", ) .default("fraxtal"), hash: z .string() .refine(isHash, { message: "Invalid hash" }) .describe("Hash from the OpenOcean contract on the blockchain."), });
  • Tool registration object defining name, description, input parameters schema, and execute handler reference.
    getTransaction: { name: "GET_TRANSACTION", description: "Get Transaction", parameters: hashParamsSchema, execute: chainExecute.getTransaction

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/openocean-finance/openocean-mcp'

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