Skip to main content
Glama

manage_notes

Add, search, retrieve, and delete session notes with content, tags, and importance levels for organized role-playing game management.

Instructions

Manage session notes. Operations: add (add note with content/tags/importance), search (search by query/tagFilter), get (get by noteId), delete (remove by noteId), list (list recent with limit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNo
contentNo
tagsNo
importanceNomedium
queryNo
tagFilterNo
noteIdNo
limitNo

Implementation Reference

  • Registration of the manage_notes tool in the central registry, linking to manageNotes handler and manageNotesSchema.
    manage_notes: {
      name: 'manage_notes',
      description: 'Manage session notes. Operations: add (add note with content/tags/importance), search (search by query/tagFilter), get (get by noteId), delete (remove by noteId), list (list recent with limit).',
      inputSchema: toJsonSchema(manageNotesSchema),
      handler: async (args) => {
        try {
          const result = await manageNotes(args);
          return result;
        } catch (err) {
          if (err instanceof z.ZodError) {
            const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
            return error(`Validation failed: ${messages}`);
          }
          const message = err instanceof Error ? err.message : String(err);
          return error(message);
        }
      },
    },
  • Zod schemas defining input validation for manage_notes tool operations: add, search, get, delete, list. Combined into discriminatedUnion on 'operation' field.
    /** Add operation schema */
    const addNoteOperationSchema = z.object({
      operation: z.literal('add'),
      content: z.string().min(1, 'Content is required'),
      tags: z.array(z.string()).optional(),
      importance: ImportanceSchema.optional().default('medium'),
    });
    
    /** Search operation schema */
    const searchNoteOperationSchema = z.object({
      operation: z.literal('search'),
      query: z.string().optional(),
      tagFilter: z.array(z.string()).optional(),
    });
    
    /** Get operation schema */
    const getNoteOperationSchema = z.object({
      operation: z.literal('get'),
      noteId: z.string(),
    });
    
    /** Delete operation schema */
    const deleteNoteOperationSchema = z.object({
      operation: z.literal('delete'),
      noteId: z.string(),
    });
    
    /** List operation schema */
    const listNoteOperationSchema = z.object({
      operation: z.literal('list'),
      limit: z.number().int().min(1).optional(),
    });
    
    /** Combined schema for manage_notes using discriminatedUnion */
    export const manageNotesSchema = z.discriminatedUnion('operation', [
      addNoteOperationSchema,
      searchNoteOperationSchema,
      getNoteOperationSchema,
      deleteNoteOperationSchema,
      listNoteOperationSchema,
    ]);
  • Primary handler function for the manage_notes tool. Parses input with manageNotesSchema, dispatches to operation-specific handlers (handleNoteAdd, handleNoteSearch, etc.), formats output using createBox, and handles errors.
    export async function manageNotes(input: unknown): Promise<{ content: { type: 'text'; text: string }[] }> {
      try {
        const parsed = manageNotesSchema.parse(input);
    
        let result: string;
    
        switch (parsed.operation) {
          case 'add':
            result = handleNoteAdd(parsed);
            break;
          case 'search':
            result = handleNoteSearch(parsed);
            break;
          case 'get':
            result = handleNoteGet(parsed);
            break;
          case 'delete':
            result = handleNoteDelete(parsed);
            break;
          case 'list':
            result = handleNoteList(parsed);
            break;
          default:
            result = createBox('ERROR', ['Unknown operation'], DISPLAY_WIDTH);
        }
    
        return { content: [{ type: 'text' as const, text: result }] };
      } catch (error) {
        const lines: string[] = [];
    
        if (error instanceof z.ZodError) {
          for (const issue of error.issues) {
            lines.push(`${issue.path.join('.')}: ${issue.message}`);
          }
        } else if (error instanceof Error) {
          lines.push(error.message);
        } else {
          lines.push('An unknown error occurred');
        }
    
        return { content: [{ type: 'text' as const, text: createBox('ERROR', lines, DISPLAY_WIDTH) }] };
      }
    }
  • In-memory storage Map for session notes, used by all note operations.
    const notesStore = new Map<string, Note>();
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It lists operations but lacks critical details: whether operations are read-only or destructive (e.g., delete is implied destructive), authentication needs, rate limits, error handling, or response formats. This is inadequate for a multi-operation tool with potential mutations.

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 appropriately sized and front-loaded, listing all operations in a single sentence with clear bullet-like structure. Every phrase adds value by specifying operations and associated parameters, with no redundant information.

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?

Given the complexity (8 parameters, multiple operations, no annotations, no output schema), the description is incomplete. It doesn't cover behavioral aspects like side effects, return values, or error conditions, leaving significant gaps for an AI agent to invoke the tool correctly in a gaming context with many sibling tools.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions parameters like content, tags, importance, query, tagFilter, noteId, and limit in the context of operations, but doesn't explain their semantics, constraints, or relationships. For example, it doesn't clarify which parameters are required for each operation or how importance values are defined.

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 tool's purpose as managing session notes with specific operations (add, search, get, delete, list), which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like manage_encounter or manage_party that might also handle notes in different contexts, so it's not fully distinguished.

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?

The description lists operations but provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, context (e.g., during gameplay vs. setup), or comparison with sibling tools like manage_encounter that might overlap in note management.

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/Mnehmos/mnehmos.chatrpg.game'

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