Skip to main content
Glama

create_directory

Create a new directory at a specified path to organize Markdown files and content within the Markdown Editor MCP Server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Core handler function in FileOperationsTool class that creates the directory using os.makedirs and handles errors.
    async def create_directory(self, path: str) -> Dict[str, Any]: """Create directory""" try: abs_path = self._get_abs_path(path) os.makedirs(abs_path, exist_ok=True) return {"success": True, "path": path} except Exception as e: return {"error": str(e)}
  • MCP tool registration defining the name, input schema (path required), and output schema.
    Tool( name="create_directory", title="Create Directory", inputSchema={ "type": "object", "properties": { "path": { "type": "string", "examples": ["./new_folder", "./docs/archive"] } }, "required": ["path"], "additionalProperties": False }, outputSchema={ "type": "object", "properties": { "success": {"type": "boolean"}, "path": {"type": "string"} } } ),
  • Tool dispatcher in the main call_tool handler that calls the create_directory function.
    elif name == "create_directory": res = await create_directory(arguments["path"]) return {"content": [TextContent(type="text", text="Directory created")], "structuredContent": res, "isError": "error" in res}
  • Top-level wrapper function imported by server.py that delegates to the class instance method.
    async def create_directory(path: str): return await _instance.create_directory(path)
  • Singleton instance of FileOperationsTool used by all wrapper functions.
    # Global instance _instance = FileOperationsTool()

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/KazKozDev/markdown-editor-mcp-server'

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