Skip to main content
Glama

listdir

Lists files and directories in a specified folder path to help users navigate and manage file systems within the editor-mcp server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirpathYes

Implementation Reference

  • The handler function for the 'listdir' tool. It lists the contents of the specified directory using os.listdir() and returns the filenames along with the path. Handles cases where the path is not a directory or other exceptions occur.
    async def listdir(dirpath: str) -> Dict[str, Any]: try: return { "filenames": os.listdir(dirpath), "path": dirpath, } except NotADirectoryError as e: return { "error": "Specified path is not a directory.", "path": dirpath, } except Exception as e: return { "error": f"Unexpected error when listing the directory: {str(e)}" }

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/danielpodrazka/editor-mcp'

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