Skip to main content
Glama

GET_TRANSACTION

Retrieve transaction details from OpenOcean's DEX contracts on supported blockchain networks 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 implements the core logic of the GET_TRANSACTION tool. It resolves the chain, uses ChainService to fetch the transaction by hash, and returns the result as JSON.
    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 schema defining the input parameters for the GET_TRANSACTION tool: optional chain (defaults to 'fraxtal') and required hash (validated with viem's isHash).
    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 object registration in tools/index.ts, defining name, description, input schema, and handler reference.
    getTransaction: {
    	name: "GET_TRANSACTION",
    	description: "Get Transaction",
    	parameters: hashParamsSchema,
    	execute: chainExecute.getTransaction
    },
  • src/index.ts:17-17 (registration)
    Final registration of the GET_TRANSACTION tool to the FastMCP server.
    server.addTool(tools.getTransaction);
Behavior1/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 but fails completely. It doesn't indicate whether this is a read-only operation, whether it requires authentication, what rate limits might apply, what happens if the transaction hash doesn't exist, or what format the response takes. The description adds zero behavioral context beyond the minimal implication of 'get' as a retrieval operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just two words, this represents under-specification rather than effective brevity. The description fails to provide necessary information that would help an AI agent understand and use the tool correctly. Every sentence should earn its place, but here the single 'sentence' (really just a phrase) doesn't earn its place by adding value.

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 blockchain transactions and the absence of both annotations and output schema, the description is completely inadequate. It doesn't explain what information is returned, what format it's in, whether this is a read operation, or any error conditions. For a tool that presumably retrieves detailed blockchain transaction data, this minimal description leaves critical gaps.

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

Parameters3/5

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

The schema description coverage is 100%, with both parameters well-documented in the schema itself. The description adds no parameter information beyond what's already in the structured schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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 'Get Transaction' is a tautology that merely restates the tool name without adding any meaningful context. It doesn't specify what kind of transaction (crypto, blockchain, etc.) or what information is retrieved. While the input schema provides some clues, the description itself fails to communicate purpose beyond the obvious.

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?

The description provides absolutely no guidance about when to use this tool versus the sibling tools (CHAIN_LIST, DEX_LIST, GAS_PRICE, QUOTE, SWAP, TOKEN_LIST). It doesn't indicate this is for retrieving transaction details versus executing transactions (SWAP) or getting quotes (QUOTE). No context about prerequisites or alternatives is mentioned.

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

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