Skip to main content
Glama
MausRundung362

Project Explorer MCP Server

list_allowed_directories

Retrieve the list of directories accessible by the MCP server to identify paths available for exploration, analysis, or file operations.

Instructions

Returns the list of directories that this MCP server is allowed to access. This is useful for understanding which directories can be explored or searched before attempting to use other tools. The allowed directories are configured when the server starts and cannot be modified at runtime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic, formatting the allowed directories into a markdown list.
    export async function handleListAllowed(args: any, allowedDirectories: string[]) { let result = "# Allowed Directories\n\n"; if (allowedDirectories.length === 0) { result += "No directories are currently allowed."; } else { result += `This MCP server has access to ${allowedDirectories.length} director${allowedDirectories.length === 1 ? 'y' : 'ies'}:\n\n`; allowedDirectories.forEach((dir, index) => { result += `${index + 1}. ${dir}\n`; }); result += "\nYou can use these directories with other tools like explore_project, search_files, etc."; } return { content: [ { type: "text", text: result } ] }; }
  • The tool schema defining name, description, and empty input schema.
    export const listAllowedTool = { name: "list_allowed_directories", description: "Returns the list of directories that this MCP server is allowed to access. This is useful for understanding which directories can be explored or searched before attempting to use other tools. The allowed directories are configured when the server starts and cannot be modified at runtime.", inputSchema: { type: "object", properties: {}, required: [] } };
  • src/index.ts:33-44 (registration)
    Registration of the tool schema in the ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ exploreProjectTool, listAllowedTool, searchTool, renameFileTool, deleteFileTool, checkOutdatedTool ] }; });
  • src/index.ts:47-77 (registration)
    Registration of the tool handler dispatch via switch case in CallToolRequestHandler.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { // Safely access arguments with null checking const args = request.params.arguments || {}; // Route to appropriate handler based on tool name switch (request.params.name) { case "list_allowed_directories": return await handleListAllowed(args, ALLOWED_DIRECTORIES); case "explore_project": return await handleExploreProject(args, ALLOWED_DIRECTORIES); case "search_files": return await handleSearch(args, ALLOWED_DIRECTORIES); case "rename_file": return await handleRenameFile(args, ALLOWED_DIRECTORIES); case "delete_file": return await handleDeleteFile(args, ALLOWED_DIRECTORIES); case "check_outdated": return await handleCheckOutdated(args, ALLOWED_DIRECTORIES); default: throw new McpError( ErrorCode.InvalidRequest, `Unknown tool: ${request.params.name}` ); } });

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/MausRundung362/mcp-explorer'

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