publishNote
Publish signed notes to Nostr relays for AI agents to share content on the decentralized network.
Instructions
Publish a signed note to relays
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signedEvent | Yes | The signed event to publish | |
| relays | No | Relays to publish to |
Implementation Reference
- src/tools/note-tools.ts:98-100 (handler)The implementation of the publishNote tool which calls publishEvent with the provided signedEvent and relays.
export async function publishNote({ signedEvent, relays }: z.infer<typeof publishNoteSchema>) { return publishEvent(signedEvent as any, relays ?? DEFAULT_RELAYS); } - src/tools/note-tools.ts:34-45 (schema)The Zod schema definition for the publishNote tool input.
export const publishNoteSchema = z.object({ signedEvent: z.object({ id: z.string(), kind: z.number(), content: z.string(), tags: z.array(z.array(z.string())), created_at: z.number(), pubkey: z.string(), sig: z.string(), }).describe('The signed event to publish'), relays: z.array(z.string()).optional().describe('Relays to publish to'), }); - src/index.ts:69-71 (registration)Registration of the publishNote tool in the MCP server instance.
server.tool('publishNote', 'Publish a signed note to relays', publishNoteSchema.shape, async (params) => { return textResult(await publishNote(params)); });