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
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Text content of the note | |
| tags | No | Event tags |
Implementation Reference
- src/tools/note-tools.ts:47-55 (handler)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; } - src/tools/note-tools.ts:11-14 (schema)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));