get_transaction
Retrieve detailed information about Solana blockchain transactions using their unique signature to verify status, confirmations, and contents.
Instructions
Get transaction details by signature
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signature | Yes | Transaction signature |
Implementation Reference
- src/index.ts:775-796 (handler)The handler function that implements the 'get_transaction' tool logic. It ensures a Solana connection, fetches the transaction by signature using connection.getTransaction, and returns key details like slot, blockTime, fee, success status, and any error.async function handleGetTransaction(args: any) { const { signature } = args; ensureConnection(); const transaction = await connection.getTransaction(signature, { commitment: "confirmed", maxSupportedTransactionVersion: 0 }); if (!transaction) { throw new Error("Transaction not found"); } return { signature, slot: transaction.slot, blockTime: transaction.blockTime, fee: transaction.meta?.fee, success: transaction.meta?.err ? false : true, error: transaction.meta?.err }; }
- src/index.ts:229-238 (schema)Input schema definition for the 'get_transaction' tool, specifying a required 'signature' string parameter.inputSchema: { type: "object", properties: { signature: { type: "string", description: "Transaction signature" } }, required: ["signature"] }
- src/index.ts:226-239 (registration)Registration of the 'get_transaction' tool in the tools array provided to ListToolsRequestHandler, including name, description, and input schema.{ name: "get_transaction", description: "Get transaction details by signature", inputSchema: { type: "object", properties: { signature: { type: "string", description: "Transaction signature" } }, required: ["signature"] } },
- src/index.ts:1312-1314 (registration)Registration/dispatch in the CallToolRequestHandler switch statement that maps the tool name to its handler function.case "get_transaction": result = await handleGetTransaction(args); break;