Skip to main content
Glama

create_agent

Create a new agent with spending limits to autonomously manage Bitcoin Lightning payments and access paid APIs through the Lightning Wallet MCP server.

Instructions

Create a new agent under your operator account. Returns the agent API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the agent
descriptionNoOptional description
budget_limit_satsNoOptional spending limit in sats

Implementation Reference

  • Handler for 'create_agent' tool call, uses the LightningFaucetClient to create a new agent.
    case 'create_agent': {
      const parsed = CreateAgentSchema.parse(args);
      const result = await session.requireClient().createAgent(
        parsed.name,
        parsed.description,
        parsed.budget_limit_sats
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: `Agent "${result.name}" created successfully`,
              agent_id: result.agentId,
              api_key: result.agentApiKey,
              name: result.name,
            }, null, 2),
          },
        ],
      };
    }
  • Implementation of createAgent in LightningFaucetClient, which sends the request to the backend.
    async createAgent(
      name: string,
      description?: string,
      budgetLimitSats?: number
    ): Promise<{
      agentId: number;
      agentApiKey: string;
      name: string;
      rawResponse: CreateAgentResponse;
    }> {
      const data: Record<string, unknown> = { name };
      if (description) data.description = description;
      if (budgetLimitSats !== undefined) data.budget_limit_sats = budgetLimitSats;
    
      const result = await this.request<CreateAgentResponse>('create_agent', data);
    
      const apiKey = result.agent_api_key || result.api_key;
      if (!apiKey) {
        throw new Error('No agent API key returned');
      }
    
      return {
        agentId: result.agent_id || 0,
        agentApiKey: apiKey,
        name: result.name || name,
        rawResponse: result,
      };
    }
  • Input schema validation for the create_agent tool.
    const CreateAgentSchema = z.object({
      name: z.string().describe('Name for the agent'),
      description: z.string().optional().describe('Optional description'),
      budget_limit_sats: z.number().min(0).optional().describe('Optional spending limit in sats'),
    });
  • src/index.ts:415-426 (registration)
    MCP tool registration for create_agent.
      name: 'create_agent',
      description: 'Create a new agent under your operator account. Returns the agent API key.',
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Name for the agent' },
          description: { type: 'string', description: 'Optional description' },
          budget_limit_sats: { type: 'integer', minimum: 0, description: 'Optional spending limit in sats' },
        },
        required: ['name'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It states the tool creates an agent and returns an API key, but doesn't disclose permissions required, rate limits, whether the operation is idempotent, or what happens on failure (e.g., duplicate names). This is a significant gap for a mutation tool with zero annotation coverage.

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 front-loads the core action and outcome with zero wasted words. It's appropriately sized for the tool's complexity.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., auth needs, error handling), doesn't explain the returned API key's format or usage, and offers minimal guidance. Given the complexity and sparse structured data, it should do more to aid the agent.

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?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no parameter-specific information beyond implying creation, which doesn't enhance understanding of 'name', 'description', or 'budget_limit_sats'. Baseline 3 is appropriate as the schema handles 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 action ('Create a new agent') and resource ('under your operator account'), with a specific outcome ('Returns the agent API key'). It distinguishes from siblings like 'list_agents' or 'delete_agent' by focusing on creation, but doesn't explicitly contrast with similar tools like 'register_operator' or 'set_agent_credentials'.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an operator account), exclusions, or comparisons to siblings like 'register_operator' or 'fund_agent', leaving the agent to infer context from tool names 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