get_allowed_paths
Lists accessible directories for file operations in the Simple MCP Server, showing which paths are available for secure access.
Instructions
アクセス可能なパスの一覧を表示します
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_allowed_paths"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:482-493 (handler)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: {}, }, }, - src/index.ts:185-188 (schema)Input schema for the 'get_allowed_paths' tool, which requires no parameters.
inputSchema: { type: "object", properties: {}, }, - src/index.ts:108-110 (helper)Helper method in PathValidator class that returns a copy of the allowed paths array.
getAllowedPaths(): string[] { return [...this.allowedPaths]; } - src/index.ts:24-30 (helper)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()), // 一時ディレクトリ ];