Skip to main content
Glama
9Ninety
by 9Ninety

writeNote

Create or update notes with a unique ID, title, summary, tags, and content on the MCP Notes server for organized and structured documentation.

Instructions

Creates or updates a note with a unique ID suffixed by a random number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent of the note
idYesUnique identifier of the note, should be unique enough like "a-note-about-python-file-server-design-109".
summaryYesShort summary of the note
tagsYesTags of the note
titleYesTitle of the note, describe what was inside the content.

Implementation Reference

  • The handler function that executes the writeNote tool: puts the note into DynamoDB using PutCommand, updates the ALL_RESOURCES list, and returns a success message.
    export const handleWriteNote = async (
      docClient: DynamoDBDocumentClient,
      tableName: string,
      note: Note,
      ALL_RESOURCES: Resource[]
    ) => {
      const command = new PutCommand({ TableName: tableName, Item: note });
      await docClient.send(command);
    
      const resourceIndex = ALL_RESOURCES.findIndex(
        (res) => res.uri === `notes://notes/${note.id}`
      );
      const newResource = {
        uri: `notes://notes/${note.id}`,
        name: note.title,
        mimeType: "application/json",
        text: JSON.stringify(note),
      };
    
      if (resourceIndex !== -1) {
        ALL_RESOURCES[resourceIndex] = newResource;
      } else {
        ALL_RESOURCES.push(newResource);
      }
    
      return {
        content: [
          {
            type: "text",
            text: `Note with ID '${note.id}' has been written/updated.`,
          },
        ],
      };
    };
  • Zod schema definition for Note (used directly as WriteNoteInputSchema), including id, title, summary, tags, content with descriptions.
    export const NoteSchema = z.object({
      id: z
        .string()
        .describe(
          'Unique identifier of the note, should be unique enough like "a-note-about-python-file-server-design-109".'
        ),
      title: z
        .string()
        .describe("Title of the note, describe what was inside the content."),
      summary: z.string().describe("Short summary of the note"),
      tags: z.array(z.string()).describe("Tags of the note"),
      content: z.string().describe("Content of the note"),
    });
    
    export type Note = z.infer<typeof NoteSchema>;
    
    export const ListNotesInputSchema = z.object({
      tags: z
        .array(z.string())
        .optional()
        .describe("Optional tags to filter notes. do not specify this if you didn't certainly sure what tags you want."),
    });
    
    export const GetNoteInputSchema = z.object({
      id: z.string().describe("ID of the note to retrieve"),
    });
    
    export const WriteNoteInputSchema = NoteSchema;
  • Registers the listTools handler which returns the list of tools including writeNote via getTools().
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      const tools: Tool[] = getTools();
      return { tools };
    });
  • Defines the MCP Tool object for writeNote with name, description, and JSON schema converted from Zod.
    {
      name: ToolName.WRITE_NOTE,
      description:
        "Creates or updates a note with a unique ID suffixed by a random number.",
      inputSchema: zodToJsonSchema(WriteNoteInputSchema) as Tool["inputSchema"],
    },
  • Dispatcher in callTool handler that validates input with WriteNoteInputSchema and invokes the handleWriteNote function.
    case ToolName.WRITE_NOTE: {
      const note = WriteNoteInputSchema.parse(args);
      return handleWriteNote(docClient, tableName, note, ALL_RESOURCES);
    }
  • Type definition enum ToolName including WRITE_NOTE = "writeNote" used throughout for tool identification.
    export enum ToolName {
      LIST_NOTES = "listNotes",
      GET_NOTE = "getNote",
      WRITE_NOTE = "writeNote",
      DELETE_NOTE = "deleteNote",
    }
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It mentions the ID includes a random number suffix, hinting at uniqueness, but lacks details on permissions, error handling, or whether updates overwrite or merge. For a mutation tool, this is inadequate disclosure.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's function without redundancy. It's front-loaded and wastes no words, making it easy for an agent to parse quickly.

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?

For a mutation tool with 5 required parameters and no annotations or output schema, the description is insufficient. It doesn't explain return values, error conditions, or the implications of 'creates or updates' (e.g., idempotency), leaving significant gaps for agent usage.

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 parameters are well-documented in the schema. The description adds no additional meaning beyond implying ID uniqueness with a random suffix, which is partially covered in the schema. Baseline 3 is appropriate as the schema handles most semantics.

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 clearly states the verb ('Creates or updates') and resource ('a note'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'getNote' or 'listNotes', which would require mentioning that this is the primary write operation versus read-only 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 alternatives. It doesn't mention prerequisites (e.g., needing an ID), compare to siblings like 'deleteNote', or specify scenarios for creation versus updates, leaving the agent without contextual usage cues.

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

Related 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/9Ninety/MCPNotes'

If you have feedback or need assistance with the MCP directory API, please join our Discord server