Skip to main content
Glama

update_task

Modify an existing pending task by updating its description or dependencies to reflect changes in task orchestration workflows.

Instructions

Update an existing pending task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the task to update
descriptionNoNew description for the task
dependenciesNoNew list of dependency task IDs

Implementation Reference

  • Executes the update_task tool: updates pending task's description or dependencies, validates task existence, status, dependency existence, and absence of cycles. Persists changes to tasks.json and returns updated task.
    case "update_task": {
      const { task_id, description, dependencies } = request.params.arguments as {
        task_id: string;
        description?: string;
        dependencies?: string[];
      };
    
      debug(`Updating task ${task_id}`);
    
      const task = tasks[task_id];
      if (!task) {
        throw new McpError(ErrorCode.InvalidRequest, `Task ${task_id} not found`);
      }
    
      if (task.status !== 'pending') {
        throw new McpError(ErrorCode.InvalidRequest, `Cannot update task ${task_id} in ${task.status} state`);
      }
    
      // Verify dependencies exist and don't create cycles
      if (dependencies) {
        const visited = new Set<string>();
        const checkCycle = (taskId: string): boolean => {
          if (visited.has(taskId)) return true;
          visited.add(taskId);
          return (tasks[taskId]?.dependencies || []).some(depId => checkCycle(depId));
        };
    
        for (const depId of dependencies) {
          if (!tasks[depId]) {
            throw new McpError(ErrorCode.InvalidRequest, `Dependency task ${depId} not found`);
          }
          if (depId === task_id || checkCycle(depId)) {
            throw new McpError(ErrorCode.InvalidRequest, `Dependencies would create a cycle`);
          }
        }
        task.dependencies = dependencies;
      }
    
      if (description) {
        task.description = description;
      }
    
      saveTasks();
      debug(`Updated task ${task_id}`);
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(task, null, 2)
        }]
      };
    }
  • src/index.ts:363-387 (registration)
    Registers the update_task tool in the listTools response, providing name, description, and input schema for task_id (required), optional description and dependencies.
    {
      name: "update_task",
      description: "Update an existing pending task",
      inputSchema: {
        type: "object",
        properties: {
          task_id: {
            type: "string",
            description: "ID of the task to update"
          },
          description: {
            type: "string",
            description: "New description for the task"
          },
          dependencies: {
            type: "array",
            items: {
              type: "string"
            },
            description: "New list of dependency task IDs"
          }
        },
        required: ["task_id"]
      }
    },
  • Defines the input schema for update_task tool.
    inputSchema: {
      type: "object",
      properties: {
        task_id: {
          type: "string",
          description: "ID of the task to update"
        },
        description: {
          type: "string",
          description: "New description for the task"
        },
        dependencies: {
          type: "array",
          items: {
            type: "string"
          },
          description: "New list of dependency task IDs"
        }
      },
      required: ["task_id"]
    }
Behavior2/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 states this updates an existing task but doesn't mention permissions needed, whether changes are reversible, error conditions, or what happens to unspecified fields. This is inadequate for a mutation tool.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error handling, or return values, leaving significant gaps for agent understanding.

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 documents all three parameters. The description adds no additional meaning about parameters beyond what's in the schema, such as format constraints or examples, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the action ('Update') and target ('an existing pending task'), providing specific verb+resource. However, it doesn't distinguish this from sibling tools like 'complete_task' or 'create_task' in terms of when to use each, which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'complete_task' or 'create_task'. It mentions 'pending task' but doesn't clarify if this is a prerequisite or exclusion criterion, leaving the agent with no usage context.

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/mokafari/orchestrator-server'

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