Skip to main content
Glama

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()), // 一時ディレクトリ ];

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