Skip to main content
Glama

note_save

Create or update notes to capture decisions, context, progress, meeting details, blockers, technical information, or release data within a structured project tracking system.

Instructions

Create or update a note. Notes capture decisions, context, progress, meeting notes, blockers, technical details, or release info. If "id" is provided, updates the existing note; otherwise creates a new one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoNote ID (omit to create new)
titleYesNote title
contentYesFull note content (markdown supported)
note_typeNogeneral
related_entity_typeNoLink note to an entity
related_entity_idNoID of the related entity
tagsNo

Implementation Reference

  • The handleNoteSave function implements the logic for creating or updating a note in the database.
    function handleNoteSave(args: Record<string, unknown>) {
      const db = getDb();
      const id = args.id as number | undefined;
      const title = args.title as string;
      const content = args.content as string;
      const noteType = (args.note_type as string) ?? 'general';
      const relatedEntityType = (args.related_entity_type as string) ?? null;
      const relatedEntityId = (args.related_entity_id as number) ?? null;
      const tags = JSON.stringify((args.tags as string[]) ?? []);
    
      if (id !== undefined) {
        // Update existing note
        const existing = db.prepare('SELECT * FROM notes WHERE id = ?').get(id);
        if (!existing) throw new Error(`Note ${id} not found`);
    
        const note = db
          .prepare(
            `UPDATE notes SET title = ?, content = ?, note_type = ?, related_entity_type = ?,
             related_entity_id = ?, tags = ?, updated_at = datetime('now')
             WHERE id = ? RETURNING *`
          )
          .get(title, content, noteType, relatedEntityType, relatedEntityId, tags, id);
    
        logActivity(db, 'note', id, 'updated', null, null, null, `Note '${title}' updated`);
        return note;
      } else {
        // Create new note
        const note = db
          .prepare(
            `INSERT INTO notes (title, content, note_type, related_entity_type, related_entity_id, tags)
             VALUES (?, ?, ?, ?, ?, ?) RETURNING *`
          )
          .get(title, content, noteType, relatedEntityType, relatedEntityId, tags);
    
        const row = note as Record<string, unknown>;
        logActivity(db, 'note', row.id as number, 'created', null, null, null, `Note '${title}' created`);
        return note;
      }
    }
  • The tool definition including input schema for note_save.
    export const definitions: Tool[] = [
      {
        name: 'note_save',
        description:
          'Create or update a note. Notes capture decisions, context, progress, meeting notes, blockers, technical details, or release info. If "id" is provided, updates the existing note; otherwise creates a new one.',
        annotations: { title: 'Save Note', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
        inputSchema: {
          type: 'object',
          properties: {
            id: { type: 'integer', description: 'Note ID (omit to create new)' },
            title: { type: 'string', description: 'Note title' },
            content: { type: 'string', description: 'Full note content (markdown supported)' },
            note_type: {
              type: 'string',
              enum: ['general', 'decision', 'context', 'meeting', 'technical', 'blocker', 'progress', 'release'],
              default: 'general',
            },
            related_entity_type: {
              type: 'string',
              enum: ['project', 'epic', 'task'],
              description: 'Link note to an entity',
            },
            related_entity_id: { type: 'integer', description: 'ID of the related entity' },
            tags: { type: 'array', items: { type: 'string' } },
          },
          required: ['title', 'content'],
        },
      },
  • Registration of the note_save tool handler within the handlers object.
    export const handlers: Record<string, ToolHandler> = {
      note_save: handleNoteSave,
      note_list: handleNoteList,
      note_search: handleNoteSearch,
      note_delete: handleNoteDelete,
    };
Behavior3/5

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

Annotations already indicate this is a non-readOnly, non-destructive, non-idempotent mutation tool. The description adds useful context by specifying the dual create/update behavior based on 'id' presence and listing types of content notes can capture, but does not disclose additional behavioral traits like rate limits, authentication needs, or error handling. No contradiction with annotations exists.

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 front-loaded with the core purpose ('Create or update a note'), followed by context and conditional logic in two efficient sentences. Every sentence adds value without redundancy, making it appropriately sized and well-structured for quick understanding.

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

Completeness4/5

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

Given the tool's complexity (7 parameters, mutation operation) and lack of output schema, the description is reasonably complete. It covers the primary functionality and usage logic, but could benefit from more details on behavioral aspects like response format or error cases, especially since annotations provide limited behavioral disclosure.

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 71%, with clear descriptions for most parameters. The description adds semantic context by explaining the conditional logic for 'id' (create vs. update) and listing possible note types, which aligns with the 'note_type' enum. However, it does not provide additional meaning for other parameters like 'related_entity_type' or 'tags' beyond what the schema offers.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('Create or update a note') and resource ('note'), and distinguishes it from siblings like note_delete, note_list, and note_search by specifying its dual create/update functionality. It also provides context about what notes capture (decisions, context, etc.), adding semantic clarity.

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

Usage Guidelines4/5

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

The description provides clear usage guidance by explaining when to use it for creation (omit 'id') vs. update (provide 'id'), which helps differentiate it from note_delete and note_list. However, it does not explicitly mention when not to use it or name specific alternatives (e.g., note_search for finding notes), leaving some room for improvement.

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/spranab/saga-mcp'

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