Skip to main content
Glama

ValueRouter MCP Server

get_transaction_status

Check the status of a USDC bridge transaction across multiple blockchain networks using the transaction hash, source chain ID, and destination chain ID.

Instructions

Get the status of a bridge transaction

Input Schema

NameRequiredDescriptionDefault
fromChainIdYesSource chain ID
toChainIdYesDestination chain ID
transactionHashYesTransaction hash to check status for

Input Schema (JSON Schema)

{ "additionalProperties": false, "properties": { "fromChainId": { "description": "Source chain ID", "oneOf": [ { "type": "number" }, { "type": "string" } ] }, "toChainId": { "description": "Destination chain ID", "oneOf": [ { "type": "number" }, { "type": "string" } ] }, "transactionHash": { "description": "Transaction hash to check status for", "type": "string" } }, "required": [ "transactionHash", "fromChainId", "toChainId" ], "type": "object" }

Implementation Reference

  • Core implementation of the get_transaction_status tool handler. Fetches transaction details from the source chain using chain-specific providers, handles simulated transactions, simulates bridge status steps, and returns structured TransactionStatus.
    async getTransactionStatus( transactionHash: string, fromChainId: SupportedChainId, toChainId: SupportedChainId ): Promise<TransactionStatus> { const fromChainIdTyped = fromChainId as SupportedChainId; const toChainIdTyped = toChainId as SupportedChainId; try { // Get transaction details from source chain const sourceTransaction = await this.getSourceTransactionDetails( transactionHash, fromChainIdTyped ); // Check if this is a simulated transaction if (transactionHash.startsWith('simulated-')) { return this.getSimulatedTransactionStatus( transactionHash, fromChainIdTyped, toChainIdTyped ); } // Get bridge transaction status const bridgeStatus = await this.getBridgeTransactionStatus( transactionHash, fromChainIdTyped, toChainIdTyped ); return bridgeStatus; } catch (error) { return { transactionHash, fromChainId: fromChainIdTyped, toChainId: toChainIdTyped, status: 'failed', steps: [ { name: 'Transaction Query', status: 'failed', timestamp: Date.now(), }, ], errorMessage: error instanceof Error ? error.message : String(error), }; } }
  • Zod schema and TypeScript type definition for the TransactionStatus output returned by the get_transaction_status tool.
    export const TransactionStatusSchema = z.object({ transactionHash: z.string(), fromChainId: z.union([z.number(), z.string()]), toChainId: z.union([z.number(), z.string()]), status: z.enum(['pending', 'scanning', 'attesting', 'minting', 'completed', 'failed']), steps: z.array(z.object({ name: z.string(), status: z.enum(['pending', 'processing', 'completed', 'failed']), transactionHash: z.string().optional(), timestamp: z.number().optional(), })), fromTxHash: z.string().optional(), toTxHash: z.string().optional(), errorMessage: z.string().optional(), completedAt: z.number().optional(), }); export type TransactionStatus = z.infer<typeof TransactionStatusSchema>;
  • src/index.ts:236-264 (registration)
    MCP tool registration in the server's listTools response, including tool name, description, and JSON input schema.
    { name: 'get_transaction_status', description: 'Get the status of a bridge transaction', inputSchema: { type: 'object', properties: { transactionHash: { type: 'string', description: 'Transaction hash to check status for', }, fromChainId: { oneOf: [ { type: 'number' }, { type: 'string' }, ], description: 'Source chain ID', }, toChainId: { oneOf: [ { type: 'number' }, { type: 'string' }, ], description: 'Destination chain ID', }, }, required: ['transactionHash', 'fromChainId', 'toChainId'], additionalProperties: false, }, },
  • Wrapper handler in the main MCP server class that handles the tool call dispatch, argument extraction, service delegation, and response formatting.
    private async getTransactionStatus(args: any): Promise<MCPToolResult> { try { const { transactionHash, fromChainId, toChainId } = args; const result = await this.statusService.getTransactionStatus( transactionHash, fromChainId, toChainId ); return createSuccessResponse(result); } catch (error) { return createErrorResponse( error instanceof Error ? error.message : String(error), 'STATUS_ERROR' ); } }
  • Helper method that simulates the multi-step bridge transaction status for demonstration purposes.
    private async getBridgeTransactionStatus( transactionHash: string, fromChainId: SupportedChainId, toChainId: SupportedChainId ): Promise<TransactionStatus> { // This would typically query the bridge service API // For now, we'll simulate the bridge status const steps = [ { name: 'Source Transaction', status: 'completed' as const, transactionHash, timestamp: Date.now() - 300000, // 5 minutes ago }, { name: 'Bridge Scanning', status: 'completed' as const, timestamp: Date.now() - 240000, // 4 minutes ago }, { name: 'Circle Attestation', status: 'completed' as const, timestamp: Date.now() - 180000, // 3 minutes ago }, { name: 'Destination Minting', status: 'processing' as const, timestamp: Date.now() - 60000, // 1 minute ago }, ]; return { transactionHash, fromChainId, toChainId, status: 'attesting', steps, fromTxHash: transactionHash, toTxHash: undefined, // Will be populated when minting completes }; }

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/RWAValueRouter/MCP'

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