Skip to main content
Glama

createNostrEvent

Generate unsigned Nostr events for AI agents to publish notes, reply, react, or send encrypted messages on the decentralized social network.

Instructions

Create an unsigned Nostr event of any kind

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYesEvent kind number
contentYesEvent content
tagsNoEvent tags

Implementation Reference

  • The handler function that creates an unsigned Nostr event template.
    export function createNostrEvent({ kind, content, tags }: z.infer<typeof createNostrEventSchema>): EventTemplate {
      return {
        kind,
        content,
        tags: tags ?? [],
        created_at: Math.floor(Date.now() / 1000),
      };
    }
  • The Zod schema defining the input requirements for the createNostrEvent tool.
    export const createNostrEventSchema = z.object({
      kind: z.number().describe('Event kind number'),
      content: z.string().describe('Event content'),
      tags: z.array(z.array(z.string())).optional().describe('Event tags'),
    });
  • src/index.ts:75-77 (registration)
    Registration of the createNostrEvent tool in the MCP server.
    server.tool('createNostrEvent', 'Create an unsigned Nostr event of any kind', createNostrEventSchema.shape, async (params) => {
      return textResult(createNostrEvent(params));
    });

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