Skip to main content
Glama

read_multiple_notes

Retrieve content from multiple note files at once by specifying their paths relative to your notes directory, returning each file's content with its corresponding path.

Instructions

Read the contents of multiple note files simultaneously. Specify paths relative to your notes directory (e.g., ['Log/2023-01-01.md', 'Rollups/2023-01-01-rollup.md']). Returns each file's content with its path as a reference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesArray of paths to note files, relative to your notes directory

Implementation Reference

  • The handler function that executes the tool logic: reads multiple note files from the notes directory, validates paths are within bounds, handles individual file errors, and formats output with separators.
    export async function handleReadMultipleNotes(notesPath: string, args: ReadMultipleNotesArgs): Promise<ToolCallResult> {
      try {
        // Validate paths is provided and is an array
        if (!args.paths || !Array.isArray(args.paths)) {
          throw new Error("'paths' parameter is required and must be an array");
        }
        
        // Process each file path
        const results = await Promise.all(
          args.paths.map(async (notePath) => {
            try {
              const filePath = path.join(notesPath, notePath);
              
              // Ensure the path is within allowed directory
              if (!filePath.startsWith(notesPath)) {
                return `${notePath}: Error - Access denied - path outside notes directory`;
              }
              
              try {
                const content = await fs.readFile(filePath, 'utf-8');
                return `${notePath}:\n${content}\n`;
              } catch (error) {
                const errorMessage = error instanceof Error ? error.message : String(error);
                return `${notePath}: Error - ${errorMessage}`;
              }
            } catch (error) {
              const errorMessage = error instanceof Error ? error.message : String(error);
              return `${notePath}: Error - ${errorMessage}`;
            }
          })
        );
        
        return {
          content: [{ type: "text", text: results.join("\n---\n") }]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: "text", text: `Error reading notes: ${errorMessage}` }],
          isError: true
        };
      }
    }
  • Tool definition object containing the name, description, and input schema (JSON Schema) for the read_multiple_notes tool.
    {
      name: "read_multiple_notes",
      description: "Read the contents of multiple note files simultaneously. " +
        "Specify paths relative to your notes directory (e.g., ['Log/2023-01-01.md', 'Rollups/2023-01-01-rollup.md']). " +
        "Returns each file's content with its path as a reference.",
      inputSchema: {
        type: "object",
        properties: {
          paths: { 
            type: "array",
            items: { type: "string" },
            description: "Array of paths to note files, relative to your notes directory" 
          }
        },
        required: ["paths"]
      },
    },
  • TypeScript interface defining the input arguments for the handler.
    interface ReadMultipleNotesArgs {
      paths: string[];
    }
  • Registration in the central tool dispatcher (handleToolCall switch statement) that routes calls to the specific handler.
    case "read_multiple_notes":
      return await handleReadMultipleNotes(notesPath, args);
  • Import of the handler and tool definitions from filesystem module into the central tools index.
      ensureDirectory,
      initializeNotesDirectory,
      handleSearchFiles,
      handleReadNote,
      handleReadMultipleNotes,
      handleListDirectory,
      handleCreateDirectory,
      getFilesystemToolDefinitions
    } from './filesystem.js';
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the batch read behavior and return format (content with paths), but lacks details on error handling (e.g., missing files), permissions, or performance implications. It adds some value but not comprehensive behavioral context.

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, followed by usage details and return format in two efficient sentences. Every sentence adds necessary information without redundancy.

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?

For a simple read tool with 1 parameter and no output schema, the description is reasonably complete—covering purpose, usage, and return values. However, without annotations or output schema, it could benefit from more behavioral details like error cases.

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 the schema already documents the 'paths' parameter fully. The description adds marginal value by providing an example path format (e.g., ['Log/2023-01-01.md', 'Rollups/2023-01-01-rollup.md']), but doesn't explain semantics beyond what the schema provides.

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 specific action ('Read the contents of multiple note files simultaneously') and resource ('note files'), distinguishing it from sibling tools like 'read_note' (singular) and 'search_files' (searching). It explicitly mentions the batch operation aspect.

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 context about when to use this tool (for reading multiple files at once) and includes an example path format, but it doesn't explicitly state when NOT to use it or name alternatives like 'read_note' for single files or 'search_files' for filtered content.

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/mikeysrecipes/mcp-notes'

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