Skip to main content
Glama

createNote

Create unsigned text notes for the Nostr protocol, enabling AI agents to publish content and interact with decentralized social networks.

Instructions

Create an unsigned kind 1 text note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesText content of the note
tagsNoEvent tags

Implementation Reference

  • The createNote function creates an unsigned Nostr text note event template.
    export function createNote({ content, tags }: z.infer<typeof createNoteSchema>) {
      const template: EventTemplate = {
        kind: KINDS.TEXT,
        content,
        tags: tags ?? [],
        created_at: Math.floor(Date.now() / 1000),
      };
      return template;
    }
  • The Zod schema for validating createNote input.
    export const createNoteSchema = z.object({
      content: z.string().describe('Text content of the note'),
      tags: z.array(z.array(z.string())).optional().describe('Event tags'),
    });
  • src/index.ts:57-58 (registration)
    Registration of the createNote tool in the MCP server.
    server.tool('createNote', 'Create an unsigned kind 1 text note', createNoteSchema.shape, async (params) => {
      return textResult(createNote(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