Skip to main content
Glama

list_directory

Retrieve and display the contents of a directory within your MCP Notes, including files and subdirectories, by specifying a relative path. Ideal for organizing and browsing your knowledge base.

Instructions

List the contents of a directory in your notes. Shows all files and directories with clear labels. Specify path relative to your notes directory (e.g., 'Log' or 'Rollups').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory path relative to notes directory (defaults to root notes directory if not provided)

Implementation Reference

  • The list_directory tool is registered here in the handleToolCall switch statement. It delegates execution to the handleListDirectory function imported from filesystem.js.
    case "list_directory":
      return await handleListDirectory(notesPath, args);
  • The schema for list_directory is provided via the spread of filesystemTools returned by getFilesystemToolDefinitions(), which includes the input schema for list_directory.
    export function getToolDefinitions(): ToolDefinition[] {
      const filesystemTools = getFilesystemToolDefinitions();
      
      return [
        {
          name: "log",
          description: "Create or update today's daily log file. Optionally add notes to the log.",
          inputSchema: {
            type: "object",
            properties: {
              notes: { 
                type: "string"
              },
              tags: { 
                type: "array",
                items: { type: "string" },
                description: `${TAG_VALIDATION_DESCRIPTION}
    
                  Analyze the note's content and identify key themes, concepts, and categories that connect it to other notes.
                  Consider:
                  - Core topics and themes present in the note
                  - Broader domains or areas of knowledge
                  - Types of information (decisions, ideas, research, etc.)
                  - Projects or contexts that might want to reference this later
                  Do not force tags - only add ones that naturally emerge from the content and would help build meaningful connections between notes.`
              }
            },
            required: ["notes", "tags"]
          }
        },
        {
          name: "evaluateInsight",
          description: `
          Evaluate the long-term value and significance of an insight or thought based on the following criteria: 
          1. Actionability (1-10): Can this be applied to future work? Is there any information that can be used to apply this thought to future work in different contexts? Is the problem it solves clear?
          2. Longevity (1-10): Will this be relevant months or years from now?
          3. Findability (1-10): Would this be hard to rediscover if forgotten?
          4. Future Reference Value (1-10): How likely are you to need this again?
          
          Insights to ignore: 
          1. Trivial syntax details
          2. Redundant information
          `,
          inputSchema: {
            type: "object",
            properties: {
              thought: { type: "string" },
              evaluationStep: { type: "number" },
              totalSteps: { type: "number" },
              nextStepNeeded: { type: "boolean" },
              actionability: { type: "number" },
              longevity: { type: "number" },
              findability: { type: "number" },
              futureReferenceValue: { type: "number" }
            },
            required: ["thought", "evaluationStep", "totalSteps", "nextStepNeeded", "actionability", "longevity", "findability", "futureReferenceValue"]
          },
        },
        {
          name: "rollup",
          description: `
           Synthesize my daily note to create an organized rollup of the most important notes with clear categories, connections, and action items. Optionally specify a date (YYYY-MM-DD).
           Only include notes that actually add long-term value. If you are unsure, call the /evaluateInsight tool to evaluate the long-term value of the thought.
           If you do not have enough information, stop and ask the user for more information.
           It is better to not log anything than log something that is not useful.
          `,
          inputSchema: {
            type: "object",
            properties: {
              date: { type: "string" },
              accomplishments: {
                type: "array",
                items: { type: "string" },
                description: "A list of accomplishments. Each accomplishment should be a short description of the work done in the day so that it can answer the question 'what did you do all day?'",
              },
              insights: {
                type: "array",  
                items: { type: "string" },
                description: "A list of insights. Each insight should be a long-term storage. Things like new knowledge gained. Do not force insights - only add ones that naturally emerge from the content and would help build meaningful connections between notes.",
              },
              todos: {
                type: "array",
                items: { type: "string" },
                description: "A list of todos. Each todo should be a short description of the task to be done. A todo should be actionable.",
              },
            },
            required: ["accomplishments", "insights"]
          },
        },
        {
          name: "write_note",
          description: "Create a new note or overwrite an existing note with content. " +
            "Path should be relative to your notes directory. " +
            "Optionally include tags that will be merged with any existing tags in the note.",
          inputSchema: {
            type: "object",
            properties: {
              path: { 
                type: "string",
                description: "Path where the note should be saved, relative to notes directory" 
              },
              content: {
                type: "string",
                description: "Content to write to the note"
              },
              tags: {
                type: "array",
                items: { type: "string" },
                description: `${TAG_VALIDATION_DESCRIPTION}
                
                Tags to add to the note's frontmatter. Will be merged with existing tags if present.`
              }
            },
            required: ["path", "content"]
          },
        },
        ...filesystemTools
      ];
    }
  • Import of the handleListDirectory handler function and getFilesystemToolDefinitions which provides the schema and other filesystem helpers.
    import {
      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?

No annotations are provided, so the description carries the full burden. It discloses that the tool 'Shows all files and directories with clear labels,' which adds useful behavioral context about the output format. However, it does not mention potential errors (e.g., if the path doesn't exist), permissions, or pagination, leaving gaps for a mutation-free tool.

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 in the first sentence, followed by additional details in a second sentence. Every sentence earns its place by clarifying scope and usage, with zero wasted words, making it highly efficient and well-structured.

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 low complexity (single optional parameter, no output schema, no annotations), the description is largely complete. It covers purpose, usage, and parameter context adequately. A 5 would require addressing minor gaps like error handling or output details, but it's sufficient for basic directory listing.

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 'path' parameter thoroughly. The description adds marginal value by reinforcing the path specification ('Specify path relative to your notes directory') and providing an example ('e.g., 'Log' or 'Rollups''), but does not add significant meaning beyond the schema. Baseline 3 is appropriate.

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 ('List the contents of a directory') and resource ('in your notes'), distinguishing it from siblings like read_note (read file content) or search_files (search across files). It specifies the scope ('Shows all files and directories with clear labels'), making the purpose unambiguous.

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 for when to use this tool ('List the contents of a directory in your notes') and includes a usage example ('Specify path relative to your notes directory'). However, it does not explicitly state when not to use it or name alternatives like search_files for filtered searches, which would have earned a 5.

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

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

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