Skip to main content
Glama

set_nostr_identity

Configure a Nostr identity for the Lightning Wallet MCP agent by securely storing the private key and deriving the public key for decentralized communication.

Instructions

Set a Nostr identity for the agent. Stores the private key and derives the public key. REQUIRES AGENT KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
private_keyYes64-character hex Nostr private key

Implementation Reference

  • Implementation of the setNostrIdentity method in the LightningFaucetClient class.
    async setNostrIdentity(privateKey: string): Promise<{
      publicKey: string;
      npub: string;
      rawResponse: ApiResponse;
    }> {
      const result = await this.request<ApiResponse & {
        public_key?: string;
        npub?: string;
      }>('set_nostr_identity', { private_key: privateKey });
    
      return {
        publicKey: result.public_key || '',
        npub: result.npub || '',
        rawResponse: result,
      };
    }
  • Zod validation schema for the set_nostr_identity tool input.
    const SetNostrIdentitySchema = z.object({
      private_key: z.string().length(64).describe('64-character hex Nostr private key (nsec decoded to hex)'),
    });
  • src/index.ts:691-700 (registration)
    Tool definition and registration for 'set_nostr_identity' in the MCP server.
      name: 'set_nostr_identity',
      description: 'Set a Nostr identity for the agent. Stores the private key and derives the public key. REQUIRES AGENT KEY.',
      inputSchema: {
        type: 'object',
        properties: {
          private_key: { type: 'string', description: '64-character hex Nostr private key' },
        },
        required: ['private_key'],
      },
    },
  • Handler logic for the 'set_nostr_identity' tool within the MCP server's request handler.
    case 'set_nostr_identity': {
      const parsed = SetNostrIdentitySchema.parse(args);
      const result = await session.requireClient().setNostrIdentity(parsed.private_key);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: 'Nostr identity set',
              public_key: result.publicKey,
              npub: result.npub,
            }, null, 2),
          },
        ],
      };
    }
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 key behavioral traits: that it stores the private key and derives the public key (implying a write/mutation operation). However, it lacks details on permissions needed beyond 'AGENT KEY', whether this operation is reversible/destructive, rate limits, or what happens on success/failure. The description adds some context but leaves significant behavioral aspects unspecified.

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 extremely concise (two sentences) and front-loaded with the core purpose. Every word earns its place: first sentence states what it does, second adds crucial behavioral detail, and 'REQUIRES AGENT KEY' provides essential context. No wasted words or redundant information.

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 this is a mutation tool (setting identity) with no annotations and no output schema, the description is minimally complete. It covers the core purpose and key behavioral aspect (key storage/derivation) plus a prerequisite. However, for a security-sensitive operation involving private keys, more context about implications, security considerations, or expected outcomes would be beneficial. The description meets basic requirements but leaves gaps for a tool of this nature.

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 the schema fully documents the single parameter 'private_key' with its type and format. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., no examples, no constraints beyond length, no explanation of key derivation process). Baseline 3 is appropriate when schema does 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 tool's purpose: 'Set a Nostr identity for the agent' with specific actions of storing the private key and deriving the public key. It distinguishes from sibling 'get_nostr_identity' by being the setter rather than getter, but doesn't explicitly contrast with other identity or key management tools like 'set_agent_credentials' or 'set_operator_key'.

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

Usage Guidelines4/5

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

The description provides clear context with 'REQUIRES AGENT KEY' indicating a prerequisite, which helps determine when to use this tool. However, it doesn't specify when NOT to use it (e.g., vs. other identity-setting tools) or mention alternatives explicitly, though the existence of 'get_nostr_identity' as a sibling implies complementary usage.

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