get-soon-testnet-last-transaction
Retrieve the most recent transaction for a specified address on the SOON testnet blockchain using the SVM-MCP server.
Instructions
Get the last transaction of an address on the Soon testnet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the last transaction for |
Implementation Reference
- src/index.ts:49-92 (handler)Handler function that gets the latest transaction signature for the address using getSignaturesForAddress (limit 1), then fetches the confirmed transaction details, handles no transactions or errors, and returns JSON stringified transaction or error message.async ({ address }) => { try { const signatures = await connectionTestnet.getSignaturesForAddress( new PublicKey(address), { limit: 1 } ); if (signatures.length === 0) { return { content: [ { type: "text", text: "No transactions found for this address", }, ], }; } const latestSignature = signatures[0].signature; const transaction = await connectionTestnet.getConfirmedTransaction( latestSignature ); return { content: [ { type: "text", text: JSON.stringify(transaction), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting transaction: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } }
- src/index.ts:44-48 (schema)Zod input schema requiring a single 'address' string parameter with description.{ address: z .string() .describe("The SOON address to get the last transaction for"), },
- src/index.ts:41-93 (registration)Registration of the tool via server.tool(), specifying name, description, input schema, and inline handler function.server.tool( "get-soon-testnet-last-transaction", "Get the last transaction of an address on the Soon testnet", { address: z .string() .describe("The SOON address to get the last transaction for"), }, async ({ address }) => { try { const signatures = await connectionTestnet.getSignaturesForAddress( new PublicKey(address), { limit: 1 } ); if (signatures.length === 0) { return { content: [ { type: "text", text: "No transactions found for this address", }, ], }; } const latestSignature = signatures[0].signature; const transaction = await connectionTestnet.getConfirmedTransaction( latestSignature ); return { content: [ { type: "text", text: JSON.stringify(transaction), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting transaction: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } } );
- src/index.ts:12-19 (registration)Tool name listed in the McpServer capabilities array.capabilities: [ "get-soon-testnet-balance", "get-soon-testnet-last-transaction", "get-soon-testnet-account-tokens", "get-soon-mainnet-balance", "get-soon-mainnet-last-transaction", "get-soon-mainnet-account-tokens", ],
- src/index.ts:6-6 (helper)Testnet RPC connection instance used by the tool's handler for Solana queries.const connectionTestnet = new Connection("https://rpc.testnet.soo.network/rpc");