Skip to main content
Glama

createNote

Generate an unsigned Nostr text note (kind 1) using provided content and optional tags. Enables AI agents to prepare publishable notes without immediate signing, supporting flexible publishing workflows.

Instructions

Create an unsigned kind 1 text note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesText content of the note
tagsNoEvent tags

Implementation Reference

  • The handler function that creates an unsigned kind 1 text note event template. Takes content and optional tags, returns an EventTemplate with kind TEXT, current timestamp, and provided content/tags.
    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;
    }
  • Zod schema for createNote tool input validation. Defines 'content' (required string) and 'tags' (optional array of string arrays).
    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-59 (registration)
    Registration of the 'createNote' tool on the MCP server with the name 'createNote', description 'Create an unsigned kind 1 text note', schema from createNoteSchema.shape, and handler that calls createNote and returns the result as text.
    server.tool('createNote', 'Create an unsigned kind 1 text note', createNoteSchema.shape, async (params) => {
      return textResult(createNote(params));
    });
  • Helper function used by the createNote handler to format the return value as a text content result for MCP.
    function textResult(data: unknown) {
      return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }] };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It states the action is to 'Create an unsigned kind 1 text note,' but gives no details about side effects (e.g., whether the note is stored locally or broadcast), error conditions, or permissions required. The term 'unsigned' hints at a behavior, but not enough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single clear sentence with no wasted words. It is appropriately concise, though it could be slightly expanded to add context without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool lacks an output schema and annotations. The description fails to explain what is returned (e.g., event ID) or provide context on when this creation occurs (e.g., does it publish? store?). More detail is needed for a creation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both 'content' and 'tags' are already described in the schema. The description adds no additional meaning beyond that. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create an unsigned kind 1 text note' clearly states the verb (Create) and resource (unsigned kind 1 text note), which distinguishes it from siblings like 'signNote' or 'publishNote' that involve different actions. However, it does not explicitly contrast with these siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus its siblings (e.g., 'postNote', 'publishNote', 'signNote'). The agent is left to infer the appropriate context without any explicit directions or caveats.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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