Skip to main content
Glama
p-united
by p-united

get_allowed_paths

Lists accessible directories for file operations in the Simple MCP Server, showing which paths are available for secure access.

Instructions

アクセス可能なパスの一覧を表示します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_allowed_paths' tool. It retrieves the allowed paths from the PathValidator and returns them formatted as a CallToolResult.
    private async getAllowedPaths(): Promise<CallToolResult> {
      const allowedPaths = this.pathValidator.getAllowedPaths();
      return {
        content: [
          {
            type: "text",
            text: `アクセス可能なパス一覧:\n\n${allowedPaths.map(p => `📁 ${p}`).join('\n')}\n\n注意: これらのディレクトリとそのサブディレクトリのみアクセス可能です。`,
          },
        ],
        isError: false,
      };
    }
  • src/index.ts:182-189 (registration)
    Registration of the 'get_allowed_paths' tool in the TOOLS array used for ListTools response, including name, description, and empty input schema.
    {
      name: "get_allowed_paths",
      description: "アクセス可能なパスの一覧を表示します",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Input schema for the 'get_allowed_paths' tool, which requires no parameters.
    inputSchema: {
      type: "object",
      properties: {},
    },
  • Helper method in PathValidator class that returns a copy of the allowed paths array.
    getAllowedPaths(): string[] {
      return [...this.allowedPaths];
    }
  • Initialization of the allowedPaths array in PathValidator constructor, defining the permitted directories.
    this.allowedPaths = [
      //path.resolve(process.cwd()), // 現在のワーキングディレクトリ
      //path.resolve(os.homedir(), 'Documents'), // ドキュメントフォルダ
      path.resolve(os.homedir(), 'Documents/00_AI_Area'), // 専用フォルダ
      //path.resolve(os.homedir(), 'Desktop'), // デスクトップ
      //path.resolve(os.tmpdir()), // 一時ディレクトリ
    ];
Behavior2/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 of behavioral disclosure. It states the tool displays accessible paths, implying a read-only operation, but doesn't cover critical aspects like whether it requires authentication, has rate limits, returns structured data, or handles errors. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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, clear sentence in Japanese: 'アクセス可能なパスの一覧を表示します'. It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple tool. Every part of the sentence earns its place by conveying 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 lack of annotations and output schema, the description is incomplete. It states what the tool does but doesn't provide enough context for effective use, such as the format of the returned list, any prerequisites (e.g., authentication), or how it differs from similar tools like 'list_directory'. For a tool in this environment, more detail is needed to be fully helpful.

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

Parameters4/5

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

The tool has 0 parameters, and the schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter details, and it appropriately doesn't mention any. This meets the baseline for tools with no parameters, as there's nothing to compensate for.

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 tool's purpose: 'アクセス可能なパスの一覧を表示します' (displays a list of accessible paths). It uses a specific verb ('表示します' - displays) and resource ('パスの一覧' - list of paths), making the function understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_directory' which might also list paths, so it doesn't reach the highest score.

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. It doesn't mention sibling tools like 'list_directory' or explain scenarios where this tool is preferred (e.g., for checking permissions vs. browsing files). Without any context on usage or exclusions, the score is low.

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/p-united/mcpSample'

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