Skip to main content
Glama

get_recent_transactions

Retrieve recent transaction history for an agent wallet to monitor blockchain activity and track financial operations.

Instructions

Get recent transactions for the agent wallet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of transactions to return (default: 10)

Implementation Reference

  • MCP tool handler for 'get_recent_transactions': parses arguments, calls wallet method, formats response as JSON.
    case "get_recent_transactions": { const { limit = 10 } = args as { limit?: number }; const transactions = await wallet.getRecentTransactions(limit); return { content: [ { type: "text", text: JSON.stringify(transactions, null, 2), }, ], }; }
  • src/index.ts:65-78 (registration)
    Tool registration including name, description, and input schema definition.
    { name: "get_recent_transactions", description: "Get recent transactions for the agent wallet.", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of transactions to return (default: 10)", }, }, required: [], }, },
  • Implements the core logic: fetches recent transaction signatures via Solana RPC and maps to simplified TransactionInfo objects.
    async getRecentTransactions(limit: number = 10): Promise<TransactionInfo[]> { const signatures = await this.connection.getSignaturesForAddress( this.keypair.publicKey, { limit } ); return signatures.map((sig) => ({ signature: sig.signature, timestamp: sig.blockTime, status: sig.err ? "failed" : "success", type: "transaction", })); }
  • Type definition for transaction information returned by the tool.
    export interface TransactionInfo { signature: string; timestamp: number | null | undefined; status: "success" | "failed"; type: string; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/noah-ing/agent-wallet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server