Skip to main content
Glama

fund_agent

Transfer Bitcoin satoshis from operator balance to fund an agent's wallet for autonomous payments and API access within the Lightning Wallet MCP server.

Instructions

Transfer sats from operator balance to an agent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesID of the agent to fund
amount_satsYesAmount in satoshis to transfer

Implementation Reference

  • Handler for the 'fund_agent' tool, which uses the session client to transfer sats.
    case 'fund_agent': {
      const parsed = FundAgentSchema.parse(args);
      const result = await session.requireClient().fundAgent(parsed.agent_id, parsed.amount_sats);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: `Transferred ${result.amountTransferred} sats to agent`,
              amount_transferred: result.amountTransferred,
              new_operator_balance: result.newOperatorBalance,
              new_agent_balance: result.newAgentBalance,
            }, null, 2),
          },
        ],
      };
    }
  • Method in the LightningFaucetClient to execute the 'fund_agent' API call.
    async fundAgent(
      agentId: number,
      amountSats: number
    ): Promise<{
      newOperatorBalance: number;
      newAgentBalance: number;
      amountTransferred: number;
      rawResponse: FundAgentResponse;
    }> {
      const result = await this.request<FundAgentResponse>('fund_agent', {
        agent_id: agentId,
        amount_sats: amountSats,
      });
    
      return {
        newOperatorBalance: result.operator_balance || result.new_operator_balance || 0,
        newAgentBalance: result.agent_balance || result.new_agent_balance || 0,
        amountTransferred: result.transferred || result.amount_transferred || amountSats,
        rawResponse: result,
      };
    }
  • Schema definition for the 'fund_agent' tool inputs.
    const FundAgentSchema = z.object({
      agent_id: z.number().int().positive().describe('ID of the agent to fund'),
      amount_sats: z.number().int().min(1).max(10_000_000).describe('Amount in satoshis to transfer'),
    });
  • src/index.ts:428-438 (registration)
    Tool registration for 'fund_agent'.
      name: 'fund_agent',
      description: 'Transfer sats from operator balance to an agent.',
      inputSchema: {
        type: 'object',
        properties: {
          agent_id: { type: 'integer', description: 'ID of the agent to fund' },
          amount_sats: { type: 'integer', minimum: 1, description: 'Amount in satoshis to transfer' },
        },
        required: ['agent_id', 'amount_sats'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the transfer action but lacks critical details: it doesn't specify if this is a mutating operation, what permissions are required, whether it's reversible, or if there are rate limits or fees. This is inadequate for a financial transaction tool.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of a financial transfer tool with no annotations and no output schema, the description is insufficient. It lacks details on behavior, error conditions, return values, and security implications, leaving significant gaps for an agent to operate safely and effectively.

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 schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional meaning beyond implying the transfer involves 'sats' (satoshis), which is already clear from the parameter names and schema. This meets the baseline for high schema coverage.

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 action ('Transfer sats') and target ('from operator balance to an agent'), which is specific and unambiguous. It distinguishes from sibling tools like 'check_balance' or 'transfer_to_agent' by specifying the funding direction, though it doesn't explicitly differentiate from all siblings like 'sweep_agent'.

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 (e.g., sufficient operator balance), exclusions, or comparisons to similar tools like 'transfer_to_agent' or 'sweep_agent', leaving the agent to infer usage context.

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