createNostrEvent
Generate unsigned Nostr events for AI agents to publish notes, reply, react, or send encrypted messages on decentralized social networks.
Instructions
Create an unsigned Nostr event of any kind
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Event kind number | |
| content | Yes | Event content | |
| tags | No | Event tags |
Implementation Reference
- src/tools/event-tools.ts:40-47 (handler)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), }; } - src/tools/event-tools.ts:11-15 (schema)Zod schema validation for createNostrEvent tool input.
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)); });