get-soon-mainnet-last-transaction
Retrieve the most recent transaction for a specified address on the Soon mainnet using the SVM-MCP server, enabling efficient blockchain activity tracking.
Instructions
Get the last transaction of an address on the Soon mainnet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the last transaction for |
Implementation Reference
- src/index.ts:161-204 (handler)The handler function fetches the most recent transaction signature for the given Solana address on the Soon mainnet using getSignaturesForAddress with limit 1, retrieves the confirmed transaction details, and returns it as a JSON string in the MCP response format. Handles no transactions and errors gracefully.async ({ address }) => { try { const signatures = await connectionMainnet.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 connectionMainnet.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:156-160 (schema)Zod schema defining the input parameter 'address' as a string with description.{ address: z .string() .describe("The SOON address to get the last transaction for"), },
- src/index.ts:153-205 (registration)The server.tool() call registers the tool with its name, description, input schema, and handler function.server.tool( "get-soon-mainnet-last-transaction", "Get the last transaction of an address on the Soon mainnet", { address: z .string() .describe("The SOON address to get the last transaction for"), }, async ({ address }) => { try { const signatures = await connectionMainnet.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 connectionMainnet.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:17-19 (registration)The tool name is listed in the McpServer capabilities array, declaring its availability."get-soon-mainnet-last-transaction", "get-soon-mainnet-account-tokens", ],
- src/index.ts:7-7 (helper)Solana Connection instance for the Soon mainnet RPC endpoint, used by the mainnet tools including this one.const connectionMainnet = new Connection("https://rpc.mainnet.soo.network/rpc");