Skip to main content
Glama

update_tasks

Modify multiple tasks by updating descriptions, statuses, priorities, due dates, or tags in a single operation using structured input. Streamlines task management for enhanced productivity.

Instructions

Update multiple tasks with new values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatesYesList of task updates to apply

Implementation Reference

  • The main handler function for the 'update_tasks' tool. It validates input using UpdateTasksSchema, iterates over updates, checks task existence and dependencies, updates via taskStorage.update, collects results, and returns JSON with success/failure counts.
    execute: async (params: any) => {
      try {
        // Validate input parameters
        const validatedParams = UpdateTasksSchema.parse(params);
        const results = [];
        
        for (const { id, ...changes } of validatedParams.updates) {
          try {
            // Verify task exists
            const task = taskStorage.get(id);
            
            if (!task) {
              results.push({
                id,
                success: false,
                error: `Task with ID ${id} not found`
              });
              continue;
            }
            
            // Validate dependencies if they exist
            if (changes.dependsOn) {
              const missingDependencies = changes.dependsOn.filter(depId => !taskStorage.get(depId));
              if (missingDependencies.length > 0) {
                results.push({
                  id,
                  success: false,
                  error: `Dependencies not found: ${missingDependencies.join(', ')}`
                });
                continue;
              }
            }
            
            // Update task
            const updatedTask = taskStorage.update(id, changes);
            
            results.push({
              id,
              success: true,
              task: updatedTask
            });
          } catch (error) {
            results.push({
              id,
              success: false,
              error: `Error updating task: ${error instanceof Error ? error.message : String(error)}`
            });
          }
        }
        
        return JSON.stringify({
          updates: results,
          success: results.filter((r: any) => r.success).length,
          failed: results.filter((r: any) => !r.success).length
        });
      } catch (error) {
        return JSON.stringify({ 
          error: `Invalid update_tasks parameters: ${error instanceof Error ? error.message : String(error)}`
        });
      }
    }
  • Zod schema definition for validating the input parameters of the update_tasks tool, defining an array of updates each with id and optional fields.
    // Schema for update_tasks parameters
    const UpdateTasksSchema = z.object({
      updates: z.array(
        z.object({
          id: z.string().uuid(),
          description: z.string().min(3, "Description must be at least 3 characters").optional(),
          status: TaskStatusEnum.optional(),
          priority: TaskPriorityEnum.optional(),
          due: z.string().datetime().optional(),
          tags: z.array(z.string()).optional(),
          dependsOn: z.array(z.string().uuid()).optional()
        })
      )
    });
  • The server.addTool call that registers the update_tasks tool within the registerTaskTools function.
    server.addTool({
      name: "update_tasks",
      description: "Update multiple tasks with new values.",
      execute: async (params: any) => {
        try {
          // Validate input parameters
          const validatedParams = UpdateTasksSchema.parse(params);
          const results = [];
          
          for (const { id, ...changes } of validatedParams.updates) {
            try {
              // Verify task exists
              const task = taskStorage.get(id);
              
              if (!task) {
                results.push({
                  id,
                  success: false,
                  error: `Task with ID ${id} not found`
                });
                continue;
              }
              
              // Validate dependencies if they exist
              if (changes.dependsOn) {
                const missingDependencies = changes.dependsOn.filter(depId => !taskStorage.get(depId));
                if (missingDependencies.length > 0) {
                  results.push({
                    id,
                    success: false,
                    error: `Dependencies not found: ${missingDependencies.join(', ')}`
                  });
                  continue;
                }
              }
              
              // Update task
              const updatedTask = taskStorage.update(id, changes);
              
              results.push({
                id,
                success: true,
                task: updatedTask
              });
            } catch (error) {
              results.push({
                id,
                success: false,
                error: `Error updating task: ${error instanceof Error ? error.message : String(error)}`
              });
            }
          }
          
          return JSON.stringify({
            updates: results,
            success: results.filter((r: any) => r.success).length,
            failed: results.filter((r: any) => !r.success).length
          });
        } catch (error) {
          return JSON.stringify({ 
            error: `Invalid update_tasks parameters: ${error instanceof Error ? error.message : String(error)}`
          });
        }
      }
    });
  • Higher-level call to registerTaskTools from registerAllTools, which includes the update_tasks tool registration.
    registerTaskTools(server);
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'updates multiple tasks with new values'. It doesn't disclose behavioral traits like whether updates are atomic, require specific permissions, what happens on partial failures, or if there are rate limits. For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that front-loads the core action. It avoids redundancy and wastes no words, though it could be slightly more informative without losing conciseness.

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 explain what values can be updated, the response format, error handling, or dependencies. Given the complexity of bulk updates and lack of structured data, more context is needed for effective use.

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 fully documents the 'updates' parameter and its nested fields (id, description, due, priority, status, tags). The description adds no additional meaning beyond implying bulk operations, which is already evident from the schema's array structure. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('update') and resource ('multiple tasks') with the scope of applying 'new values'. It distinguishes from siblings like 'complete_task' or 'list_tasks' by specifying bulk updates. However, it doesn't explicitly differentiate from 'update_relations' or other update operations.

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 'complete_task' for single updates or 'plan_tasks' for task planning. The description lacks context about prerequisites, such as needing existing task IDs, or when bulk updates are appropriate versus individual operations.

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

Related 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/flight505/mcp-think-tank'

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