Skip to main content
Glama

set_operator_key

Switch operator API keys to authenticate subsequent requests with different credentials in the Lightning Wallet MCP server.

Instructions

Switch to a different operator API key for subsequent requests. Use after register_operator to start using the new credentials.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYesThe operator API key

Implementation Reference

  • Handler for the 'set_operator_key' tool which updates the API key in the session state.
    case 'set_operator_key': {
      const parsed = SetOperatorKeySchema.parse(args);
      session.setClient(new LightningFaucetClient(parsed.api_key));
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: 'Switched to operator credentials. Subsequent requests will use this API key.',
            }, null, 2),
          },
        ],
      };
    }
  • Schema for validating the input to 'set_operator_key'.
    const SetOperatorKeySchema = z.object({
      api_key: z.string().min(10, 'API key is too short').max(200, 'API key is too long')
        .describe('The operator API key to use for subsequent requests'),
    });
  • src/index.ts:449-458 (registration)
    Tool registration for 'set_operator_key'.
      name: 'set_operator_key',
      description: 'Switch to a different operator API key for subsequent requests. Use after register_operator to start using the new credentials.',
      inputSchema: {
        type: 'object',
        properties: {
          api_key: { type: 'string', description: 'The operator API key' },
        },
        required: ['api_key'],
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the tool's effect ('for subsequent requests') and prerequisite ('after register_operator'), which are useful behavioral traits. However, it doesn't mention authentication requirements, error conditions, or what happens to existing sessions/state, leaving gaps for a mutation 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 perfectly concise with two sentences that each earn their place: the first states the purpose, the second provides usage guidance. It's front-loaded with the core function and wastes no words.

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?

For a mutation tool with no annotations and no output schema, the description is adequate but incomplete. It covers purpose and usage context well, but lacks details on behavioral implications (e.g., authentication changes, error handling) and return values. Given the complexity of credential management, more context would be helpful.

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

Parameters4/5

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

Schema description coverage is 100%, so the schema fully documents the single parameter. The description doesn't add any parameter-specific details beyond what the schema provides ('The operator API key'), but with 0 parameters requiring extra explanation, a baseline of 4 is appropriate as the description doesn't need to compensate.

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

Purpose5/5

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

The description clearly states the specific action ('Switch to a different operator API key') and resource ('for subsequent requests'), distinguishing it from siblings like 'register_operator' (initial registration) and 'rotate_api_key' (key rotation). It explicitly defines the tool's function as credential switching.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('Use after register_operator to start using the new credentials'), establishing a clear prerequisite relationship. It differentiates from 'register_operator' (initial setup) and implies this is for post-registration key switching, though it doesn't explicitly name alternatives like 'rotate_api_key'.

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