get_folders
Retrieve available folders from a specified space to organize and manage workspace content within the Dart MCP Server environment.
Instructions
Get available folders
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_duid | Yes | Space DUID to get folders from |
Implementation Reference
- src/index.ts:347-358 (registration)Registration of the get_folders tool in the ListTools response, including name, description, and input schema requiring space_duidname: 'get_folders', description: 'Get available folders', inputSchema: { type: 'object', properties: { space_duid: { type: 'string', description: 'Space DUID to get folders from', } }, required: ['space_duid'], },
- src/index.ts:349-357 (schema)Input schema for get_folders toolinputSchema: { type: 'object', properties: { space_duid: { type: 'string', description: 'Space DUID to get folders from', } }, required: ['space_duid'],
- src/index.ts:776-813 (handler)Handler implementation for get_folders tool. It generates Python code that imports and calls get_folders from the dart library with the provided space_duid, lists the folders, and returns the output via stdio.case 'get_folders': { console.error('[Debug] Handling get_folders request'); const pythonCode = ` # Get folders for the space print("[Debug] Getting folders", file=sys.stderr) try: # Get folders using the get_folders function from dart module space_duid = "${args.space_duid}" print(f"[Debug] Getting folders for space: {space_duid}", file=sys.stderr) from dart import get_folders folders = get_folders(space_duid, include_special=True) # Include all folders print("[Debug] Got folders:", folders, file=sys.stderr) # Print folder titles or indicate no folders found if not folders: print("No folders found in this space") else: print("Available folders:") for folder in folders: print(f"- {folder.title} (DUID: {folder.duid}, Kind: {folder.kind})") except Exception as e: print(f"[Debug] Error getting folders: {str(e)}", file=sys.stderr) traceback.print_exc(file=sys.stderr) sys.exit(1)`; // Add proper indentation to the Python code const command = pythonCode.split('\n').map(line => line.length > 0 ? ' ' + line : line).join('\n'); console.error('[Debug] Running Python command for getting folders'); const output = await this.runDartCommand(command); console.error('[Debug] Get folders output:', output); const response = { content: [{ type: 'text', text: output, }], }; return response; }