get_default_space
Retrieve the default space DUID to identify the primary workspace for organizing tasks and documents in the Dart MCP server.
Instructions
Get the default space DUID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:710-740 (handler)The handler for the 'get_default_space' tool. It constructs Python code that retrieves the first space from bundle.spaces and prints its DUID, then executes it via runDartCommand and returns the output as text content.case 'get_default_space': { console.error('[Debug] Handling get_default_space request'); // Note: Using raw string with proper indentation for the run_command function const pythonCode = ` # Get default space print("[Debug] Getting default space", file=sys.stderr) try: spaces = bundle.spaces print("[Debug] Got spaces:", spaces, file=sys.stderr) if not spaces: print("No spaces found") sys.exit(1) default_space = spaces[0] print(f"Default space DUID: {default_space['duid']}") except Exception as e: print(f"[Debug] Error getting space: {str(e)}", 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 default space'); const output = await this.runDartCommand(command); console.error('[Debug] Get default space output:', output); const response = { content: [{ type: 'text', text: output, }], }; return response; }
- src/index.ts:243-250 (registration)Registration of the 'get_default_space' tool in the ListTools response, including its name, description, and input schema (empty object, no parameters required).name: 'get_default_space', description: 'Get the default space DUID', inputSchema: { type: 'object', properties: {}, required: [], }, },