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
| Name | Required | Description | Default |
|---|---|---|---|
| fromChainId | Yes | Source chain ID | |
| toChainId | Yes | Destination chain ID | |
| transactionHash | Yes | Transaction 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
- src/services/status.ts:54-102 (handler)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), }; } }
- src/types/index.ts:133-150 (schema)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, }, },
- src/index.ts:430-445 (handler)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' ); } }
- src/services/status.ts:197-238 (helper)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 }; }