Skip to main content
Glama

test_docs_path

Tests the document path configuration for the MCP Document Server to ensure proper access to markdown files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler logic for the 'test_docs_path' tool. It attempts to list all .md files in the '../documents/' directory using the listMarkdownFiles helper, resolves the directory path, and returns a text content block with the results or an error message if the directory cannot be read.
    async () => {
      const baseDir = '../documents/';
      try {
        const files = await listMarkdownFiles(baseDir);
        return {
          content: [{ 
            type: "text", 
            text: `Directory path: ${path.resolve(baseDir)}\n\nFiles found:\n${files.join('\n')}` 
          }]
        };
      } catch (error) {
        return {
          content: [{ 
            type: "text", 
            text: `Error reading directory: ${error.message}\n\nAttempted path: ${path.resolve(baseDir)}` 
          }]
        };
      }
    }
  • Empty input schema for 'test_docs_path', indicating the tool takes no parameters.
    {},
  • tools/index.js:15-36 (registration)
    Registration of the 'test_docs_path' tool within the registerTools function, specifying the name, schema, and handler.
    mcpServer.tool("test_docs_path",
      {},
      async () => {
        const baseDir = '../documents/';
        try {
          const files = await listMarkdownFiles(baseDir);
          return {
            content: [{ 
              type: "text", 
              text: `Directory path: ${path.resolve(baseDir)}\n\nFiles found:\n${files.join('\n')}` 
            }]
          };
        } catch (error) {
          return {
            content: [{ 
              type: "text", 
              text: `Error reading directory: ${error.message}\n\nAttempted path: ${path.resolve(baseDir)}` 
            }]
          };
        }
      }
    );
  • Helper function imported and used by the test_docs_path handler to list Markdown files (.md) in the specified base directory, filtering out dotfiles.
    export async function listMarkdownFiles(baseDir) {
        try {
          const dirents = await fs.readdir(baseDir, { withFileTypes: true });
          return dirents
            .filter(dirent => 
              dirent.isFile() && 
              dirent.name.toLowerCase().endsWith('.md') &&
              !dirent.name.startsWith('.')
            )
            .map(dirent => dirent.name);
        } catch (error) {
          if (error.code === 'ENOENT') {
            throw new FileSystemError('Directory not found', 'ENOENT');
          }
          if (error.code === 'EACCES') {
            throw new FileSystemError('Permission denied', 'EACCES');
          }
          throw new FileSystemError(`Error listing files: ${error.message}`, error.code);
        }
      }
  • server.js:21-21 (registration)
    Invocation of registerTools which includes the registration of test_docs_path among other tools.
    registerTools(mcpServer);
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

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

Parameters1/5

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

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/motiondesignlv/MCP_server'

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