Skip to main content
Glama

extend_current_task

Add subtasks to break complex work into manageable pieces, creating hierarchical structures for organized problem-solving.

Instructions

Add a subtask to organize and decompose work. Creates hierarchical structure for complex tasks. Subtasks help break down work into manageable pieces. You can work on tasks in any order using switch_focus. Example: Task A → Task B → Task C creates a nested structure, but you can jump between them freely. For unrelated work, use create_new_task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesBrief task description (max 256 chars)
bodyYesFull task context, notes, and details

Implementation Reference

  • Main handler function that executes the tool: calls task_manager.extend_current_task and formats response with focus path and warnings.
    async def handle_extend_current_task(self, title: str, body: str) -> Dict[str, Any]:
        try:
            task = self.task_manager.extend_current_task(title, body)
            response = {
                "task_id": task.id,
                "message": f"Added subtask: {task.title}",
                "focus_path": self.task_manager.get_focus_path(),
                "is_current": True,
                "hint": "Use switch_focus to work on any task in any order",
            }
    
            # Add warning if getting deep
            stack_depth = self.task_manager.get_stack_depth()
            if stack_depth >= 4:
                response["info"] = (
                    f"Stack is {stack_depth} levels deep. Consider using create_new_task for unrelated work."
                )
    
            return response
        except ValueError as e:
            return {"error": str(e)}
  • Tool schema definition including input schema for title and body parameters.
    Tool(
        name="extend_current_task",
        description="Add a subtask to organize and decompose work. Creates hierarchical structure for complex tasks. Subtasks help break down work into manageable pieces. You can work on tasks in any order using switch_focus. Example: Task A → Task B → Task C creates a nested structure, but you can jump between them freely. For unrelated work, use create_new_task.",
        inputSchema={
            "type": "object",
            "properties": {
                "title": {
                    "type": "string",
                    "description": "Brief task description (max 256 chars)",
                },
                "body": {
                    "type": "string",
                    "description": "Full task context, notes, and details",
                },
            },
            "required": ["title", "body"],
        },
    ),
  • src/server.py:52-54 (registration)
    Registration of the tool handler in the call_tool dispatcher map.
    "extend_current_task": lambda: handlers.handle_extend_current_task(
        arguments["title"], arguments["body"]
    ),
  • Core logic method that creates and adds a new SubTask to the current main task stack.
    def extend_current_task(self, title: str, body: str) -> SubTask:
        if self.is_zen_state:
            raise ValueError(
                "Cannot extend task in zen state. Create a new task first."
            )
    
        if self.current_task:
            self.current_task.status = TaskStatus.PENDING
    
        new_sub_task = SubTask(title=title, body=body)
        new_sub_task.status = TaskStatus.CURRENT
    
        last_main_task = self.global_tasks[-1]
        last_main_task.add_sub_task(new_sub_task)
    
        self._manual_current_task = None  # Clear manual focus
    
        return new_sub_task
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It describes the tool's function (creating hierarchical subtask structure) and mentions freedom to work on tasks in any order, but doesn't cover important behavioral aspects like whether this operation is reversible, what permissions are needed, or how it affects existing task structures beyond the basic creation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It starts with the core purpose, explains the hierarchical structure concept, provides usage guidance, and gives an example. Every sentence adds value, though the example could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 parameters, 100% schema coverage, and no output schema, the description provides good context. It explains the tool's purpose, distinguishes it from alternatives, and gives usage examples. The main gap is lack of information about return values or error conditions, but given the tool's relative simplicity, the description is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter-specific information beyond what's in the schema. It focuses on the tool's purpose and usage rather than parameter details, which is appropriate given the complete schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Add a subtask', 'Creates hierarchical structure') and resources ('organize and decompose work', 'complex tasks'). It distinguishes from sibling tools by explicitly mentioning 'create_new_task' for unrelated work, showing clear differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool vs alternatives: 'For unrelated work, use create_new_task.' It also mentions 'switch_focus' for working on tasks in any order, giving clear context for usage decisions among sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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