Skip to main content
Glama
cheezcake

Aidderall MCP Server

by cheezcake

switch_focus

Switch focus to any task by ID to navigate your workspace, jump between tasks in any order, revisit completed work, or change priorities on the fly.

Instructions

Switch focus to ANY task by ID. The primary way to navigate your task workspace - jump between tasks in any order, revisit completed work, or change priorities on the fly. Current task retains its status, target task becomes current. Use get_big_picture or get_stack_overview to see task IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe ID of the task to switch focus to

Implementation Reference

  • The handler function that executes the switch_focus tool. It calls TaskManager.switch_focus and handles errors.
    async def handle_switch_focus(self, task_id: str) -> Dict[str, Any]: try: result = self.task_manager.switch_focus(task_id) return result except ValueError as e: return {"error": str(e)}
  • The input schema and Tool definition for the switch_focus tool.
    Tool( name="switch_focus", description="Switch focus to ANY task by ID. The primary way to navigate your task workspace - jump between tasks in any order, revisit completed work, or change priorities on the fly. Current task retains its status, target task becomes current. Use get_big_picture or get_stack_overview to see task IDs.", inputSchema={ "type": "object", "properties": { "task_id": { "type": "string", "description": "The ID of the task to switch focus to", } }, "required": ["task_id"], }, ),
  • src/server.py:48-75 (registration)
    The tool registration in the server, mapping 'switch_focus' to its handler.
    handler_map = { "create_new_task": lambda: handlers.handle_create_new_task( arguments["title"], arguments["body"] ), "extend_current_task": lambda: handlers.handle_extend_current_task( arguments["title"], arguments["body"] ), "get_current_task": handlers.handle_get_current_task, "get_big_picture": lambda: handlers.handle_get_big_picture( arguments.get("format", "text") ), "complete_current_task": handlers.handle_complete_current_task, "get_completed_tasks": lambda: handlers.handle_get_completed_tasks( arguments.get("order", "chronological") ), "update_current_task": lambda: handlers.handle_update_current_task( arguments["body"] ), "get_stack_overview": handlers.handle_get_stack_overview, "peek_context": lambda: handlers.handle_peek_context( arguments.get("include_body", False) ), "list_siblings": lambda: handlers.handle_list_siblings( arguments.get("include_body", False) ), "switch_focus": lambda: handlers.handle_switch_focus(arguments["task_id"]), "remove_task": lambda: handlers.handle_remove_task(arguments["task_id"]), }
  • The core implementation logic for switching focus to a task by ID, updating statuses and manual current task.
    def switch_focus(self, task_id: str) -> Dict[str, Any]: """Switch focus to any pending task by ID.""" # Find the task in the structure target_task: Optional[Task] = None for main_task in self.global_tasks: if main_task.id == task_id and main_task.status != TaskStatus.COMPLETED: target_task = main_task break for sub_task in main_task.sub_tasks: if sub_task.id == task_id and sub_task.status != TaskStatus.COMPLETED: target_task = sub_task break if target_task: break if not target_task: raise ValueError(f"Task with ID '{task_id}' not found or already completed") # If it's already the current task, nothing to do if target_task == self.current_task: return { "success": True, "message": "Task is already the current focus", "task_id": task_id, } # Set old current task to PENDING if self.current_task: self.current_task.status = TaskStatus.PENDING # Set new task to CURRENT target_task.status = TaskStatus.CURRENT # Set the manual current task self._manual_current_task = target_task # Return helpful context about the switch return { "success": True, "message": f"Switched focus to task: {target_task.title}", "task_id": task_id, "new_focus_path": self.get_focus_path(), }

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/cheezcake/aidderall_mcp'

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