Skip to main content
Glama

get_transactions

Retrieve transaction history from a Bitcoin Lightning wallet, including both incoming and outgoing payments, with pagination support for managing large datasets.

Instructions

Get the agent transaction history. Returns both incoming and outgoing payments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax transactions to return
offsetNoNumber to skip for pagination

Implementation Reference

  • The tool request handler for 'get_transactions' in the MCP server implementation. It parses the request arguments using 'GetTransactionsSchema', calls the 'LightningFaucetClient' method, and formats the response.
    case 'get_transactions': {
      const parsed = GetTransactionsSchema.parse(args);
      const result = await session.requireClient().getTransactions(parsed.limit, parsed.offset);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              transactions: result.transactions,
              total: result.total,
              has_more: result.has_more,
            }, null, 2),
          },
        ],
      };
    }
  • The Zod schema definition for input validation of the 'get_transactions' tool.
    const GetTransactionsSchema = z.object({
      limit: z.number().min(1).max(200).default(50).describe('Max transactions to return'),
      offset: z.number().min(0).default(0).describe('Number to skip for pagination'),
    });
  • The actual implementation of the 'getTransactions' method in the 'LightningFaucetClient' class, which communicates with the Lightning Faucet API.
    async getTransactions(
      limit: number = 50,
      offset: number = 0
    ): Promise<{
      transactions: Array<{
        type: 'incoming' | 'outgoing';
        amount_sats: number;
        fee_sats?: number;
        memo?: string;
        payment_hash?: string;
        timestamp?: string;
        balance_after?: number;
      }>;
      total: number;
      has_more: boolean;
      rawResponse: GetTransactionsResponse;
    }> {
      const result = await this.request<GetTransactionsResponse>('get_transactions', {
        limit,
        offset,
      });
    
      const transactions = (result.transactions || []).map(tx => ({
        type: (tx.type === 'deposit' || tx.type === 'incoming' || tx.amount_sats > 0
          ? 'incoming' : 'outgoing') as 'incoming' | 'outgoing',
        amount_sats: Math.abs(tx.amount_sats),
        fee_sats: tx.fee_sats,
        memo: tx.memo || tx.description,
        payment_hash: tx.payment_hash,
        timestamp: tx.timestamp || tx.created_at || tx.settled_at,
        balance_after: tx.balance_after,
      }));
    
      return {
        transactions,
        total: result.total || transactions.length,
        has_more: result.has_more || false,
        rawResponse: result,
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the scope ('both incoming and outgoing payments') but doesn't cover critical aspects like authentication requirements, rate limits, pagination behavior beyond the offset parameter, error conditions, or whether this is a read-only operation. For a financial transaction tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two clear sentences that convey the core purpose and scope. There's no wasted language or redundancy. However, it could be slightly more front-loaded by combining the two ideas into a single more comprehensive statement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (financial transaction history), lack of annotations, and no output schema, the description is minimally adequate. It covers what data is retrieved but misses important context about authentication, permissions, data format, error handling, and typical use cases. The agent would need to make assumptions about these aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what's already in the schema (which has 100% coverage). It doesn't explain the relationship between limit/offset parameters, typical values, or how pagination works in practice. With complete schema documentation, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('agent transaction history'), specifying it returns both incoming and outgoing payments. This distinguishes it from siblings like 'check_balance' or 'get_budget_status' which focus on current balances or budget status rather than historical transactions. However, it doesn't explicitly differentiate from potential transaction-related tools that might exist in other contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, appropriate contexts, or compare with siblings like 'transfer_to_agent' or 'pay_invoice' which might involve transaction creation rather than retrieval. The agent must infer usage from the tool name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/lightningfaucet/lightning-wallet-mcp'

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