Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

addSubtask

Add a subtask to a parent task to break down larger tasks into smaller, manageable components.

Instructions

Add subtask

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentIdYes
titleYes

Implementation Reference

  • The actual implementation of addSubtask: reads tasks, creates a new subtask with an auto-incremented ID (parentId.subTaskIndex), adds it to the parent task's subtasks array, writes tasks back, and returns success with the subtaskId.
    function addSubtask(workspaceRoot, parentId, options, tasksData) {
      const shouldWrite = options.write !== false;
      if (!tasksData) {
        tasksData = readTasks(workspaceRoot);
      }
      const { task: parentTask } = findTask(tasksData, parentId);
    
      if (!parentTask) {
        throw new Error(`Parent task with ID ${parentId} not found.`);
      }
      
      // Initialize lastSubtaskIndex if it doesn't exist
      if (parentTask.lastSubtaskIndex === undefined) {
        parentTask.lastSubtaskIndex = 0;
      }
      
      // Create new subtask index
      const subTaskIndex = parentTask.lastSubtaskIndex + 1;
      const newSubtaskId = `${parentId}.${subTaskIndex}`;
      
      // Create new subtask
      const newSubtask = {
        id: newSubtaskId,
        title: options.title,
        status: 'todo',
        createdAt: new Date().toISOString(),
        updatedAt: new Date().toISOString(),
        activityLog: [] // Initialize activityLog
      };
      
      // Add initial activity log entry
      addActivityLog(newSubtask, `Subtask created with title: "${newSubtask.title}"`);
      
      // Add to parent's subtasks
      parentTask.subtasks.push(newSubtask);
      parentTask.lastSubtaskIndex = subTaskIndex;
      
      if (shouldWrite) {
        writeTasks(workspaceRoot, tasksData);
      }
    
      // Return data instead of logging
      return { success: true, message: `Added new subtask (ID: ${newSubtaskId}) to task ${parentId}: "${newSubtask.title}"`, subtaskId: newSubtaskId };
    }
  • MCP tool registration with inputSchema: the addSubtask tool requires parentId (number) and title (string).
    { name:'addSubtask', description:'Add subtask', inputSchema:{ type:'object', properties:{ parentId:{type:'number'}, title:{type:'string'} }, required:['parentId','title'] } },
  • MCP tools/list registration declares the addSubtask tool with its name, description, and inputSchema.
    { name:'addSubtask', description:'Add subtask', inputSchema:{ type:'object', properties:{ parentId:{type:'number'}, title:{type:'string'} }, required:['parentId','title'] } },
  • MCP tools/call handler: validates required parameters (parentId, title) then delegates to core.addSubtask().
    case 'addSubtask':
      if (!args.parentId || !args.title) { sendError(id,-32602,'Missing required parameters for addSubtask: parentId and/or title'); return; }
      data = core.addSubtask(workspaceRoot, args.parentId, { title: args.title });
      break;
  • Enhancement wrapper (enhanceAddSubtask) that ensures the returned result always has id = subtaskId for backward compatibility.
    function enhanceAddSubtask(originalAddSubtask) {
      return function(workspaceRoot, parentId, options, tasksData) {
        const result = originalAddSubtask(workspaceRoot, parentId, options, tasksData);
        
        // Ensure backward compatibility
        if (result && result.success && result.subtaskId) {
          result.id = result.subtaskId;
          
          // Allow numeric-style access
          result.valueOf = function() { return result.subtaskId; };
          result.toString = function() { return result.subtaskId; };
        }
        
        return result;
      };
    }
Behavior2/5

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

No annotations are present, and the description lacks details about behavioral traits such as whether parentId must reference an existing task, error handling, or side effects.

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

Conciseness2/5

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

The description is extremely brief but fails to provide essential information. Conciseness without substance is not effective.

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

Completeness2/5

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

Given the absence of annotations and output schema, the description is insufficient to understand tool usage, especially with two required parameters that lack explanation.

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

Parameters2/5

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

The input schema has 0% description coverage, and the tool description does not explain the meaning or constraints of 'parentId' and 'title'. The purpose of each parameter is unclear.

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

Purpose2/5

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

The description 'Add subtask' is vague; it states the action but does not clarify what a subtask is or how it differs from the sibling 'addTask'. It is nearly a tautology.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'addTask' or 'updateTask'. The context of parentId vs top-level task is missing.

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/FutureAtoms/agentic-control-framework'

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