Skip to main content
Glama
disnet
by disnet

get_notes

Retrieve multiple notes by their identifiers from a local vault, with optional field selection and vault specification for AI collaboration workflows.

Instructions

Retrieve multiple notes by their identifiers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifiersYesArray of note identifiers in format "type/filename" or full path
vault_idNoOptional vault ID to operate on. If not provided, uses the current active vault.
fieldsNoOptional array of field names to include in response. Supports dot notation for nested fields (e.g. "metadata.tags") and wildcard patterns (e.g. "metadata.*"). If not specified, all fields are returned.

Implementation Reference

  • The primary handler for the 'get_notes' MCP tool. Validates input arguments, resolves the vault context to obtain a noteManager, fetches multiple notes concurrently using Promise.allSettled for error resilience, applies optional field filtering, and returns a structured JSON response with success/failure statistics.
    handleGetNotes = async (args: GetNotesArgs) => {
      // Validate arguments
      validateToolArgs('get_notes', args);
    
      const { noteManager } = await this.resolveVaultContext(args.vault_id);
    
      const results = await Promise.allSettled(
        args.identifiers.map(async identifier => {
          try {
            const note = await noteManager.getNote(identifier);
            if (!note) {
              throw new Error(`Note not found: ${identifier}`);
            }
    
            // Apply field filtering if specified
            const filteredNote = filterNoteFields(note, args.fields);
    
            return { success: true, note: filteredNote };
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : 'Unknown error';
            return { success: false, error: errorMessage };
          }
        })
      );
    
      const processedResults = results.map((result, index) => {
        if (result.status === 'fulfilled') {
          return result.value;
        } else {
          return {
            success: false,
            error: `Failed to retrieve note ${args.identifiers[index]}: ${result.reason}`
          };
        }
      });
    
      const successful = processedResults.filter(r => r.success).length;
      const failed = processedResults.filter(r => !r.success).length;
    
      const responseData = {
        success: true,
        results: processedResults,
        total_requested: args.identifiers.length,
        successful,
        failed
      };
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(responseData, null, 2)
          }
        ]
      };
    };
  • Registers the 'get_notes' tool within the MCP server's CallToolRequestSchema handler, routing calls to the NoteHandlers instance's handleGetNotes method.
    return await this.noteHandlers.handleGetNotes(
      args as unknown as GetNotesArgs
    );
  • Defines the JSON schema for the 'get_notes' tool input, specifying required 'identifiers' array and optional 'vault_id' and 'fields'.
      name: 'get_notes',
      description: 'Retrieve multiple notes by their identifiers',
      inputSchema: {
        type: 'object',
        properties: {
          identifiers: {
            type: 'array',
            items: {
              type: 'string'
            },
            description: 'Array of note identifiers in type/filename format'
          },
          vault_id: {
            type: 'string',
            description:
              'Optional vault ID to search in. If not provided, uses the current active vault.'
          },
          fields: {
            type: 'array',
            items: {
              type: 'string'
            },
            description:
              'Optional list of fields to include in response (id, title, content, type, filename, path, created, updated, size, metadata)'
          }
        },
        required: ['identifiers']
      }
    },
  • TypeScript interface defining the expected arguments for the get_notes handler.
    export interface GetNotesArgs {
      identifiers: string[];
      vault_id?: string;
      fields?: string[];
    }
  • Validation rules for 'get_notes' tool arguments, ensuring identifiers are non-empty arrays of valid 'type/filename' strings.
    get_notes: [
      {
        field: 'identifiers',
        required: true,
        type: 'array',
        arrayItemType: 'string',
        allowEmpty: false,
        minLength: 1,
        customValidator: (value: any) => {
          for (const identifier of value) {
            if (!identifier.includes('/')) {
              return `identifier "${identifier}" must be in format "type/filename"`;
            }
            const parts = identifier.split('/');
            if (parts.length !== 2 || !parts[0] || !parts[1]) {
              return `identifier "${identifier}" must be in format "type/filename" with both parts non-empty`;
            }
          }
          return null;
        }
      },
      {
        field: 'vault_id',
        required: false,
        type: 'string',
        allowEmpty: false
      },
      {
        field: 'fields',
        required: false,
        type: 'array',
        arrayItemType: 'string',
        allowEmpty: true
      }
    ],
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic action. It doesn't mention whether this is a read-only operation, what happens with invalid identifiers, whether there are rate limits, authentication requirements, or what format the response takes. For a tool with 3 parameters and no output schema, this leaves significant behavioral gaps.

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 states the core functionality without any wasted words. It's appropriately sized for a straightforward retrieval tool and front-loads the essential 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 tool has 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'retrieve' actually returns (full note content? metadata only?), how errors are handled, or provide context about the note system. For a batch operation tool in a complex ecosystem with many siblings, more guidance is needed.

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 all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the schema descriptions (format details for identifiers, optional vault_id behavior, fields wildcard patterns). This meets the baseline expectation when schema does the heavy lifting.

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 'retrieve' and resource 'multiple notes by their identifiers', making the purpose specific and understandable. However, it doesn't differentiate from sibling tools like 'get_note' (singular) or 'list_notes_by_type', leaving room for potential confusion about when to use this batch retrieval versus other listing/searching tools.

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 provides no guidance on when to use this tool versus alternatives. With many sibling tools available (get_note, list_notes_by_type, search_notes, etc.), there's no indication whether this is for batch retrieval of known identifiers versus searching for unknown notes or listing by criteria. The agent must infer usage from the name alone.

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/disnet/flint-note'

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