get_folders
Retrieve available folders within a specified space using the provided Space DUID, enabling efficient workspace organization and task management with Dart MCP Server integration.
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:776-813 (handler)Handler for the 'get_folders' tool. Constructs and executes Python code that imports and calls 'get_folders' from the 'dart' library with the provided space_duid, then returns the formatted output listing folders.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; }
- src/index.ts:350-358 (schema)Input schema for the 'get_folders' tool, defining the required 'space_duid' parameter.type: 'object', properties: { space_duid: { type: 'string', description: 'Space DUID to get folders from', } }, required: ['space_duid'], },
- src/index.ts:347-359 (registration)Registration of the 'get_folders' tool in the listTools response, including name, description, and schema.name: 'get_folders', description: 'Get available folders', inputSchema: { type: 'object', properties: { space_duid: { type: 'string', description: 'Space DUID to get folders from', } }, required: ['space_duid'], }, },