Skip to main content
Glama

whoami

Identify your current role and account details within the Lightning Wallet MCP server, including operator or agent status, ID, name, and balance.

Instructions

Get current context - returns whether you are operating as an operator or agent, along with ID, name, and balance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'whoami' which processes the request, calls the underlying client, and formats the response.
    case 'whoami': {
      WhoamiSchema.parse(args);
      const result = await session.requireClient().whoami();
      const response: Record<string, unknown> = {
        success: true,
        type: result.type,
        id: result.id,
        name: result.name,
        balance_sats: result.balanceSats,
      };
      if (result.type === 'operator') {
        response.agent_count = result.agentCount;
      } else {
        response.budget_limit_sats = result.budgetLimitSats;
        response.operator_id = result.operatorId;
      }
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
  • The client implementation that makes the actual API call to the 'whoami' endpoint.
    async whoami(): Promise<{
      type: 'operator' | 'agent';
      id: number;
      name: string;
      balanceSats: number;
      agentCount?: number;  // For operators
      budgetLimitSats?: number;  // For agents
      operatorId?: number;  // For agents
      rawResponse: WhoamiResponse;
    }> {
      const result = await this.request<WhoamiResponse>('whoami');
    
      return {
        type: result.type || 'agent',
        id: result.id || 0,
        name: result.name || 'Unknown',
        balanceSats: result.balance_sats || 0,
        agentCount: result.agent_count,
        budgetLimitSats: result.budget_limit_sats,
        operatorId: result.operator_id,
        rawResponse: result,
      };
    }
  • src/index.ts:471-478 (registration)
    The tool definition for 'whoami' registered in the MCP tool list.
      name: 'whoami',
      description: 'Get current context - returns whether you are operating as an operator or agent, along with ID, name, and balance.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • The Zod input validation schema for the 'whoami' tool.
    const WhoamiSchema = z.object({});
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool returns identity and balance data but doesn't disclose behavioral aspects like whether this requires authentication, has rate limits, affects system state, or what format the return data takes. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 purpose ('Get current context') followed by specific return details. Every word earns its place with no redundancy or unnecessary elaboration, making it immediately understandable.

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 has no parameters, no annotations, and no output schema, the description provides the essential purpose but lacks completeness for operational use. It doesn't explain the return format, authentication requirements, or error conditions. For a context-querying tool in a server with many financial/agent management siblings, more behavioral 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?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description appropriately doesn't discuss parameters since none exist, maintaining focus on what the tool returns rather than what it accepts. This meets the baseline expectation for parameterless tools.

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 'current context', specifying it returns identity and balance information. It distinguishes from siblings like 'get_info' by focusing on operator/agent status rather than general system information. However, it doesn't explicitly differentiate from 'check_balance' which might overlap in balance reporting.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or compare with sibling tools like 'check_balance' or 'get_info' that might provide related information. The agent must infer usage from the 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