list_agents
Display all AI agents in your Lightning Wallet MCP operator account to manage spending limits and budget controls.
Instructions
List all agents under your operator account.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1080-1095 (handler)MCP tool handler for 'list_agents' which calls the client's listAgents method.
case 'list_agents': { ListAgentsSchema.parse(args); const result = await session.requireClient().listAgents(); return { content: [ { type: 'text', text: JSON.stringify({ success: true, agents: result.agents, total: result.agents.length, }, null, 2), }, ], }; } - src/lightning-faucet.ts:508-530 (handler)The actual implementation in the LightningFaucetClient class that makes the API request to the backend.
async listAgents(): Promise<{ agents: Array<{ id: number; name: string; balance_sats: number; is_active: boolean; }>; rawResponse: ListAgentsResponse; }> { const result = await this.request<ListAgentsResponse>('list_agents'); const agents = (result.agents || []).map(agent => ({ id: agent.id, name: agent.name, balance_sats: agent.balance_sats, is_active: agent.is_active, })); return { agents, rawResponse: result, }; } - src/index.ts:145-145 (schema)Input schema definition for the list_agents tool.
const ListAgentsSchema = z.object({}); - src/index.ts:440-447 (registration)Tool registration definition for 'list_agents' in the server tool list.
name: 'list_agents', description: 'List all agents under your operator account.', inputSchema: { type: 'object', properties: {}, required: [], }, },