get_transaction
Retrieve detailed information about a specific transaction on the Penumbra blockchain using its unique hash. Facilitates privacy-preserving transaction queries on the Penumbra MCP Server.
Instructions
Get details of a specific transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | Transaction hash |
Implementation Reference
- src/index.ts:251-281 (handler)The main handler function that executes the get_transaction tool logic, fetching transaction details by hash (currently mock data).private async getTransaction(hash: string) { try { // TODO: Implement actual transaction query return { content: [ { type: 'text', text: JSON.stringify({ hash, status: "success", height: "1000000", timestamp: new Date().toISOString(), gasUsed: "50000", fee: "0.001" }, null, 2), }, ], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error fetching transaction: ${errorMessage}`, }, ], isError: true, }; } }
- src/index.ts:113-126 (registration)Registration of the get_transaction tool in the ListTools response, including name, description, and input schema.{ name: 'get_transaction', description: 'Get details of a specific transaction', inputSchema: { type: 'object', properties: { hash: { type: 'string', description: 'Transaction hash', }, }, required: ['hash'], }, },
- src/index.ts:116-125 (schema)Input schema defining the expected parameters for the get_transaction tool (hash: string).inputSchema: { type: 'object', properties: { hash: { type: 'string', description: 'Transaction hash', }, }, required: ['hash'], },
- src/index.ts:161-169 (handler)Dispatch handler in CallToolRequestSchema that validates input and calls the getTransaction method.case 'get_transaction': if (!request.params.arguments?.hash || typeof request.params.arguments.hash !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'Transaction hash must be a string' ); } return await this.getTransaction(request.params.arguments.hash); case 'get_dex_state':