Skip to main content
Glama

updateTask

Modify task properties like assignees, due dates, descriptions, attachments, and status to keep project tasks current and accurate.

Instructions

Update an existing task. Modify the properties of an existing task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesThe ID of the task to update
taskRequestYesThe task data to update

Implementation Reference

  • The main execution handler for the 'updateTask' tool. Validates input, invokes the service layer to perform the API update, handles errors, and formats the response.
    export async function handleUpdateTask(input: any) {
      logger.verbose("=== updateTask tool called ===");  
      try {
        
        const taskId = input.taskId;
        const taskRequest = input.taskRequest as TaskRequest;
    
        if (!taskId) {
          logger.error("Invalid request: missing taskId");
          return {
            content: [{
              type: "text",
              text: "Invalid request: missing taskId. Please provide a taskId."
            }]
          };
        }
        
        if (!taskRequest || !taskRequest.task) {
          return {
            content: [{
              type: "text",
              text: "Invalid request: missing taskRequest.task. Please provide task data to update."
            }]
          };
        }    
        // Call the service to update the task
        const response = await teamworkService.updateTask(taskId.toString(), taskRequest);
           
        return {
          content: [{
            type: "text",
            text: JSON.stringify(response, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Updating task');
      }
    } 
  • The tool definition including name, description, detailed input schema for taskId and taskRequest, and annotations.
    export const updateTaskDefinition = {
      name: "updateTask",
      description: "Update an existing task. Modify the properties of an existing task.",
      inputSchema: {
        type: 'object',
        properties: {
          taskId: {
            type: 'integer',
            description: 'The ID of the task to update'
          },
          taskRequest: {
            type: 'object',
            properties: {
              attachmentOptions: {
                type: 'object',
                properties: {
                  removeOtherFiles: {
                    type: 'boolean'
                  }
                },
                required: []
              },
              attachments: {
                type: 'object',
                properties: {
                  files: {
                    type: 'array',
                    items: {
                      type: 'object',
                      properties: {
                        categoryId: {
                          type: 'integer'
                        },
                        id: {
                          type: 'integer'
                        }
                      },
                      required: [],
                      description: 'File stores information about a uploaded file.'
                    }
                  },
                  pendingFiles: {
                    type: 'array',
                    items: {
                      type: 'object',
                      properties: {
                        categoryId: {
                          type: 'integer'
                        },
                        reference: {
                          type: 'string'
                        }
                      },
                      required: [],
                      description: 'PendingFile stores information about a file uploaded on-the-fly.'
                    }
                  }
                },
                required: []
              },
              card: {
                type: 'object',
                properties: {
                  columnId: {
                    type: 'integer'
                  }
                },
                required: [],
                description: 'Card stores information about the card created with the task.'
              },
              predecessors: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'integer'
                    },
                    type: {
                      type: 'string'
                    }
                  },
                  required: [],
                  description: 'Predecessor stores information about task predecessors.'
                }
              },
              tags: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    color: {
                      type: 'string'
                    },
                    name: {
                      type: 'string'
                    },
                    projectId: {
                      type: 'integer'
                    }
                  },
                  required: [],
                  description: 'Tag contains all the information returned from a tag.'
                }
              },
              task: {
                type: 'object',
                properties: {
                  assignees: {
                    type: 'object',
                    properties: {
                      companyIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      teamIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      userIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      }
                    },
                    required: [],
                    description: 'UserGroups are common lists for storing users, companies and teams ids together.'
                  },
                  attachmentIds: {
                    type: 'array',
                    items: {
                      type: 'integer'
                    }
                  },
                  changeFollowers: {
                    type: 'object',
                    properties: {
                      companyIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      teamIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      userIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      }
                    },
                    required: [],
                    description: 'UserGroups are common lists for storing users, companies and teams ids together.'
                  },
                  commentFollowers: {
                    type: 'object',
                    properties: {
                      companyIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      teamIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      userIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      }
                    },
                    required: [],
                    description: 'UserGroups are common lists for storing users, companies and teams ids together.'
                  },
                  completedAt: {
                    type: 'string'
                  },
                  completedBy: {
                    type: 'integer'
                  },
                  createdAt: {
                    type: 'string'
                  },
                  createdBy: {
                    type: 'integer'
                  },
                  crmDealIds: {
                    type: 'array',
                    items: {
                      type: 'integer'
                    }
                  },
                  customFields: {
                    type: 'object',
                    properties: {
                      Values: {
                        type: 'array',
                        items: {
                          type: 'object',
                          properties: {
                            countryCode: {
                              type: 'string'
                            },
                            currencySymbol: {
                              type: 'string'
                            },
                            customfieldId: {
                              type: 'integer'
                            },
                            urlTextToDisplay: {
                              type: 'string'
                            },
                            value: {
                              type: 'string'
                            }
                          },
                          required: [],
                          description: 'CustomFieldValue contains all the information returned from a customfield.'
                        }
                      }
                    },
                    required: [],
                    description: 'CustomFields is the custom fields type.'
                  },
                  description: {
                    type: 'string'
                  },
                  descriptionContentType: {
                    type: 'string'
                  },
                  dueAt: {
                    type: 'string',
                    format: 'date',
                    description: 'NullableDate implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted. Date format \'2006-01-02\''
                  },
                  estimatedMinutes: {
                    type: 'integer'
                  },
                  grantAccessTo: {
                    type: 'object',
                    properties: {
                      companyIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      teamIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      userIds: {
                        type: 'array',
                        items: {
                          type: 'integer'
                        },
                        description: 'NullableInt64Slice implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      }
                    },
                    required: [],
                    description: 'UserGroups are common lists for storing users, companies and teams ids together.'
                  },
                  hasDeskTickets: {
                    type: 'boolean'
                  },
                  name: {
                    type: 'string'
                  },
                  originalDueDate: {
                    type: 'string',
                    format: 'date',
                    description: 'NullableDate implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted. Date format \'2006-01-02\''
                  },
                  parentTaskId: {
                    type: 'integer'
                  },
                  priority: {
                    type: 'string',
                    enum: [
                      'low',
                      'normal',
                      'high'
                    ],
                    description: 'NullableTaskPriority implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                  },
                  private: {
                    type: 'boolean'
                  },
                  progress: {
                    type: 'integer'
                  },
                  reminders: {
                    type: 'array',
                    items: {
                      type: 'object',
                      properties: {
                        isRelative: {
                          type: 'boolean'
                        },
                        note: {
                          type: 'string'
                        },
                        relativeNumberDays: {
                          type: 'integer'
                        },
                        remindAt: {
                          type: 'string'
                        },
                        type: {
                          type: 'string'
                        },
                        userId: {
                          type: 'integer'
                        }
                      },
                      required: [],
                      description: 'Reminder stores all necessary information to create a task reminder.'
                    }
                  },
                  repeatOptions: {
                    type: 'object',
                    properties: {
                      duration: {
                        type: 'integer'
                      },
                      editOption: {
                        type: 'string'
                      },
                      endsAt: {
                        type: 'string',
                        format: 'date',
                        description: 'NullableDate implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted. Date format \'2006-01-02\''
                      },
                      frequency: {
                        type: 'object',
                        description: 'NullableTaskRepeatFrequency implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      monthlyRepeatType: {
                        type: 'object',
                        description: 'NullableTaskRepeatMonthlyType implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      },
                      rrule: {
                        type: 'string',
                        description: 'Adds the RRule definition for repeating tasks. It replaces all other repeating fields.'
                      },
                      selectedDays: {
                        type: 'object',
                        description: 'NullableWorkingHourEntryWeekdays implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted.'
                      }
                    },
                    required: [],
                    description: 'RepeatOptions stores recurring information for the task.'
                  },
                  startAt: {
                    type: 'string',
                    format: 'date',
                    description: 'NullableDate implements json.Unmarshaler to allow testing between a value that explicitly set to null or omitted. Date format \'2006-01-02\''
                  },
                  status: {
                    type: 'string'
                  },
                  tagIds: {
                    type: 'array',
                    items: {
                      type: 'integer'
                    }
                  },
                  taskgroupId: {
                    type: 'integer'
                  },
                  tasklistId: {
                    type: 'integer'
                  },
                  templateRoleName: {
                    type: 'string'
                  },
                  ticketId: {
                    type: 'integer'
                  }
                },
                required: [],
                description: 'Task contains all the information returned from a task.'
              },
              taskOptions: {
                type: 'object',
                properties: {
                  appendAssignees: {
                    type: 'boolean'
                  },
                  checkInvalidusers: {
                    type: 'boolean'
                  },
                  everyoneMustDo: {
                    type: 'boolean'
                  },
                  fireWebhook: {
                    type: 'boolean'
                  },
                  isTemplate: {
                    type: 'boolean'
                  },
                  logActivity: {
                    type: 'boolean'
                  },
                  notify: {
                    type: 'boolean'
                  },
                  parseInlineTags: {
                    type: 'boolean'
                  },
                  positionAfterTaskId: {
                    type: 'integer'
                  },
                  pushDependents: {
                    type: 'boolean'
                  },
                  pushSubtasks: {
                    type: 'boolean'
                  },
                  shiftProjectDates: {
                    type: 'boolean'
                  },
                  useDefaults: {
                    type: 'boolean'
                  },
                  useNotifyViaTWIM: {
                    type: 'boolean'
                  }
                },
                required: [],
                description: 'Options contains any options which can be set for the task request'
              },
              workflows: {
                type: 'object',
                properties: {
                  positionAfterTask: {
                    type: 'integer'
                  },
                  stageId: {
                    type: 'integer'
                  },
                  workflowId: {
                    type: 'integer'
                  }
                },
                required: [],
                description: 'Workflows stores information about where the task lives in the workflow'
              }
            },
            required: [],
            description: 'The task data to update'
          }
        },
        required: ['taskId', 'taskRequest']
      },
      annotations: {
        title: "Update a Task",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Import statement bringing in the updateTask tool definition and handler for registration.
    import { updateTaskDefinition as updateTask, handleUpdateTask } from './tasks/updateTask.js';
  • Registration of the updateTask tool in the toolPairs array, associating definition with handler.
    { definition: updateTask, handler: handleUpdateTask },
  • Helper service function that performs the actual API PATCH request to update a task in Teamwork, called by the tool handler.
    export async function updateTask(taskId: string, taskData: TaskRequest) {
      try {
        const apiClient = await ensureApiClient();
        const url = `/tasks/${taskId}.json`;
        
        // Make the PATCH request to update the task
        const response = await apiClient.patch(url, taskData);
        if (response.status === 200) {
          if (response.data.task.name) {
            return `Task '${response.data.task.name}' updated successfully`;
          } else {
            return `Task updated successfully`;        
          }
        } else {
          throw new Error(response.data.message.status);
        }
      } catch (error: any) {
        logger.error(`Error updating task ${taskId}: ${error.message}`);
            
        throw new Error(error.message);
      }
    }
Behavior3/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, confirming this is a mutation but not destructive. The description adds no behavioral context beyond 'update'—no mention of permissions, side effects, rate limits, or response format. With annotations covering safety, it meets a baseline but lacks enrichment like what happens to unspecified fields or error conditions.

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?

Two concise sentences with zero waste, front-loading the core action. However, it's overly brief for a complex tool—more detail could improve utility without sacrificing efficiency. It avoids redundancy but under-specifies given the rich input schema.

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 output schema, complex nested parameters, and annotations only covering basic hints, the description is inadequate. It doesn't explain what 'update' entails (e.g., partial vs. full updates), return values, or error handling. Siblings like 'createTask' suggest a task-management context, but this isn't leveraged for completeness.

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%, with detailed parameter docs (e.g., 'taskId: The ID of the task to update', 'taskRequest: The task data to update'). The description adds no param semantics beyond this, not even hinting at updatable fields like name or dueAt. Baseline 3 is appropriate as the schema does heavy lifting.

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 'Update an existing task. Modify the properties of an existing task.' is tautological—it restates the tool name 'updateTask' without adding specificity. It mentions 'properties' but doesn't distinguish what types of properties (e.g., name, assignees, due dates) or how this differs from sibling tools like 'createTask' or 'updatePerson'.

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

Usage Guidelines1/5

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

No guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing task ID), exclusions, or comparisons to siblings like 'createTask' for new tasks or 'updatePerson' for different resources. The agent must infer usage from context alone.

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/Vizioz/Teamwork-MCP'

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