get_transaction
Retrieve detailed information about specific transactions on the Algorand blockchain by providing the transaction ID.
Instructions
Get transaction details by transaction ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txId | Yes | Transaction ID |
Implementation Reference
- src/index.ts:702-725 (handler)Main handler for the 'get_transaction' tool: parses arguments using Zod schema, fetches transaction via algorandService, returns formatted JSON response or error.case 'get_transaction': { const parsed = GetTransactionArgsSchema.parse(args); try { const txInfo = await algorandService.getTransaction(parsed.txId); return { content: [ { type: 'text', text: `Transaction Information:\n${JSON.stringify(txInfo, null, 2)}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting transaction: ${error}`, }, ], isError: true, }; } }
- src/index.ts:75-77 (schema)Zod schema defining input validation for get_transaction tool arguments (txId: string).const GetTransactionArgsSchema = z.object({ txId: z.string(), });
- src/index.ts:309-322 (registration)MCP tool registration entry defining name, description, and input schema for 'get_transaction'.{ name: 'get_transaction', description: 'Get transaction details by transaction ID', inputSchema: { type: 'object', properties: { txId: { type: 'string', description: 'Transaction ID', }, }, required: ['txId'], }, },
- src/algorand.ts:330-337 (helper)Supporting method in AlgorandService that retrieves transaction information using algodClient.pendingTransactionInformation.async getTransaction(txId: string) { try { const txInfo = await this.algodClient.pendingTransactionInformation(txId).do(); return txInfo; } catch (error) { throw new Error(`Failed to get transaction: ${error}`); } }