Skip to main content
Glama

note_list

Read-onlyIdempotent

Filter and retrieve notes by type, entity, or tag. Returns results sorted by most recent first for quick review.

Instructions

List notes with optional filters. Returns notes sorted by most recent first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
note_typeNo
related_entity_typeNo
related_entity_idNo
tagNoFilter by a single tag
limitNo

Implementation Reference

  • The main handler function for note_list. Builds a SQL query with optional filters (note_type, related_entity_type, related_entity_id, tag) and returns notes sorted by created_at DESC with a limit.
    function handleNoteList(args: Record<string, unknown>) {
      const db = getDb();
      const noteType = args.note_type as string | undefined;
      const relatedEntityType = args.related_entity_type as string | undefined;
      const relatedEntityId = args.related_entity_id as number | undefined;
      const tag = args.tag as string | undefined;
      const limit = (args.limit as number) ?? 30;
    
      const whereClauses: string[] = [];
      const params: unknown[] = [];
    
      if (noteType) {
        whereClauses.push('note_type = ?');
        params.push(noteType);
      }
      if (relatedEntityType) {
        whereClauses.push('related_entity_type = ?');
        params.push(relatedEntityType);
      }
      if (relatedEntityId !== undefined) {
        whereClauses.push('related_entity_id = ?');
        params.push(relatedEntityId);
      }
      if (tag) {
        addTagFilter(whereClauses, params, tag, 'notes');
      }
    
      const whereStr = whereClauses.length > 0 ? `WHERE ${whereClauses.join(' AND ')}` : '';
    
      const sql = `SELECT * FROM notes ${whereStr} ORDER BY created_at DESC LIMIT ?`;
      params.push(limit);
    
      return db.prepare(sql).all(...params);
    }
  • Schema/definition for note_list tool, including description, annotations (readOnlyHint: true), and inputSchema with optional filters: note_type, related_entity_type, related_entity_id, tag, limit.
    name: 'note_list',
    description: 'List notes with optional filters. Returns notes sorted by most recent first.',
    annotations: { title: 'List Notes', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
    inputSchema: {
      type: 'object',
      properties: {
        note_type: {
          type: 'string',
          enum: ['general', 'decision', 'context', 'meeting', 'technical', 'blocker', 'progress', 'release'],
        },
        related_entity_type: { type: 'string', enum: ['project', 'epic', 'task'] },
        related_entity_id: { type: 'integer' },
        tag: { type: 'string', description: 'Filter by a single tag' },
        limit: { type: 'integer', default: 30 },
      },
    },
  • Registration of handleNoteList under the key 'note_list' in the exported handlers record.
    export const handlers: Record<string, ToolHandler> = {
      note_save: handleNoteSave,
      note_list: handleNoteList,
      note_search: handleNoteSearch,
      note_delete: handleNoteDelete,
    };
  • The addTagFilter helper function used by handleNoteList to add a JSON tag filter to SQL WHERE clauses.
    export function addTagFilter(
      whereClauses: string[],
      params: unknown[],
      tag: string,
      table: string
    ): void {
      whereClauses.push(
        `EXISTS (SELECT 1 FROM json_each(${table}.tags) WHERE json_each.value = ?)`
      );
      params.push(tag);
    }
Behavior4/5

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

Annotations already provide readOnlyHint, destructiveHint, idempotentHint. Description adds valuable behavioral details: sorting by most recent first and optional filters. No contradictions.

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?

Single, front-loaded sentence that conveys purpose and key behavior. No extraneous 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?

No output schema, so description should explain return values. Only mentions sorting order, not field structure, pagination, or scope. openWorldHint=false suggests limited set, but not explained.

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 only 20% (only 'tag' parameter has description). The description says 'optional filters' but adds no specific meaning for the 4 other parameters beyond enum constraints.

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?

Clearly states the action 'List notes' with optional filters and sorting behavior. Distinguishes from siblings like note_search which likely searches text content.

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

Usage Guidelines3/5

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

Implies usage with optional filters and sorting, but does not explicitly specify when to use this tool over note_search or note_get. No exclusion criteria or alternative guidance.

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