Skip to main content
Glama

createProfile

Create a new Nostr profile with display name, bio, picture, NIP-05, lightning address, banner, website, and publish to relays.

Instructions

Create a new Nostr profile (kind 0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoDisplay name
aboutNoBio / about text
pictureNoProfile picture URL
nip05NoNIP-05 identifier
lud16NoLightning address
bannerNoBanner image URL
websiteNoWebsite URL
privateKeyNoPrivate key (nsec or hex). Optional when NOSTR_BUNKER_URI is configured.
relaysNoRelays to publish to

Implementation Reference

  • The main handler function for createProfile. Extracts privateKey, relays from params, delegates to buildAndPublishProfile which creates a kind 0 metadata event.
    export async function createProfile(params: z.infer<typeof createProfileSchema>) {
      const { privateKey, relays, ...fields } = params;
      return buildAndPublishProfile(fields, privateKey, relays);
  • Helper function that builds a Nostr kind 0 event (profile metadata), signs it (via bunker or private key), and publishes to relays.
    async function buildAndPublishProfile(
      fields: Record<string, string | undefined>,
      privateKey: string | undefined,
      relays: string[] | undefined,
    ): Promise<{ event: VerifiedEvent; published: { successes: string[]; failures: string[] } }> {
      const content: Record<string, string> = {};
      for (const [k, v] of Object.entries(fields)) {
        if (v !== undefined) content[k] = v;
      }
    
      const template: EventTemplate = {
        kind: KINDS.METADATA,
        content: JSON.stringify(content),
        tags: [],
        created_at: Math.floor(Date.now() / 1000),
      };
    
      let signed: VerifiedEvent;
      if (isBunkerMode()) {
        signed = await signEventWithBunker(template);
      } else {
        if (!privateKey) throw new Error('privateKey is required when NOSTR_BUNKER_URI is not configured');
        const sk = normalizePrivateKey(privateKey);
        signed = finalizeEvent(template, sk);
      }
    
      const result = await publishEvent(signed, relays ?? DEFAULT_RELAYS);
      return { event: signed, published: result };
    }
  • Zod schema defining the input validation for createProfile: name, about, picture, nip05, lud16, banner, website, privateKey, relays.
    export const createProfileSchema = z.object({
      name: z.string().optional().describe('Display name'),
      about: z.string().optional().describe('Bio / about text'),
      picture: z.string().optional().describe('Profile picture URL'),
      nip05: z.string().optional().describe('NIP-05 identifier'),
      lud16: z.string().optional().describe('Lightning address'),
      banner: z.string().optional().describe('Banner image URL'),
      website: z.string().optional().describe('Website URL'),
      privateKey: z.string().optional().describe(privateKeyDesc),
      relays: z.array(z.string()).optional().describe('Relays to publish to'),
    });
  • src/index.ts:89-91 (registration)
    Registration of the 'createProfile' MCP tool on the server, wiring it to the createProfile handler.
    server.tool('createProfile', 'Create a new Nostr profile (kind 0)', createProfileSchema.shape, async (params) => {
      return textResult(await createProfile(params));
    });
  • src/index.ts:18-22 (registration)
    Import statements bringing createProfileSchema and createProfile from the profile-tools module.
    // Profile tools
    import {
      createProfileSchema, updateProfileSchema,
      createProfile, updateProfile,
    } from './tools/profile-tools.js';
Behavior2/5

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

No annotations provided, and the description only states the basic action. Does not disclose side effects (e.g., whether it replaces an existing profile), authentication requirements, or output behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, earning its place by stating the tool's core function. However, it could be expanded slightly to improve usability without losing conciseness.

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?

Given the tool has 9 parameters, no output schema, and no annotations, the description is too brief. It does not explain what the tool returns or how the profile is created, leaving significant gaps for an 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?

Input schema has 100% coverage with descriptions for each parameter, so baseline is 3. The description adds no additional parameter meaning beyond what the schema already provides.

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?

Description clearly states 'Create a new Nostr profile (kind 0)', which provides a specific verb and resource. It distinguishes the profile creation from other event types but does not differentiate from the sibling 'updateProfile' tool.

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 on when to use this tool vs alternatives like 'updateProfile' or 'createNostrEvent'. No context on prerequisites or conditions for use.

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/jorgenclaw/nostr-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server