Skip to main content
Glama

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
NameRequiredDescriptionDefault
signedEventYesThe signed event to publish
relaysNoRelays to publish to

Implementation Reference

  • 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);
    }
  • 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));
    });

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