Skip to main content
Glama

update_task

Modify an existing task's name, billing defaults, and active status. Only provided fields are updated.

Instructions

Update an existing task. Can modify task name, billing settings, and activity status. Only provided fields will be updated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the task to update (required)
nameNoUpdate task name
billable_by_defaultNoUpdate default billing status
default_hourly_rateNoUpdate default hourly rate
is_defaultNoUpdate default task status
is_activeNoUpdate active status

Implementation Reference

  • The UpdateTaskHandler class implementing the ToolHandler interface. Its execute() method validates input via UpdateTaskSchema, calls harvestClient.updateTask(), and returns the result.
    class UpdateTaskHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(UpdateTaskSchema, args, 'update task');
          logger.info('Updating task via Harvest API', { taskId: validatedArgs.id });
          const task = await this.config.harvestClient.updateTask(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(task, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'update_task');
        }
      }
    }
  • The UpdateTaskSchema definition using Zod. It extends CreateTaskSchema.partial() (making all create fields optional) and adds a required 'id' field.
    export const UpdateTaskSchema = CreateTaskSchema.partial().extend({
      id: z.number().int().positive(),
    });
  • Registration of the 'update_task' tool in the registerTaskTools() function. Defines the tool name, description, input schema (id required, fields optional), and maps to UpdateTaskHandler.
    {
      tool: {
        name: 'update_task',
        description: 'Update an existing task. Can modify task name, billing settings, and activity status. Only provided fields will be updated.',
        inputSchema: {
          type: 'object',
          properties: {
            id: { type: 'number', description: 'The ID of the task to update (required)' },
            name: { type: 'string', minLength: 1, description: 'Update task name' },
            billable_by_default: { type: 'boolean', description: 'Update default billing status' },
            default_hourly_rate: { type: 'number', minimum: 0, description: 'Update default hourly rate' },
            is_default: { type: 'boolean', description: 'Update default task status' },
            is_active: { type: 'boolean', description: 'Update active status' },
          },
          required: ['id'],
          additionalProperties: false,
        },
      },
      handler: new UpdateTaskHandler(config),
    },
  • The actual HTTP client method for update. Extracts 'id' from input, destructures updateData, and sends a PATCH request to /tasks/{id}.
    async updateTask(input: any): Promise<any> {
      try {
        const { id, ...updateData } = input;
        
        this.logger.debug('Updating task', {
          taskId: id,
          updateFields: Object.keys(updateData)
        });
        
        const response = await this.client.patch(`/tasks/${id}`, updateData);
        
        this.logger.info('Successfully updated task', {
          taskId: response.data.id,
          taskName: response.data.name
        });
        
        return response.data;
      } catch (error) {
        this.logger.error('Failed to update task:', error);
        throw error;
      }
    }
  • The delegation method in the main HarvestApi class that forwards updateTask calls to the tasksClient.
    async updateTask(input: any): Promise<any> {
      return this.tasksClient.updateTask(input);
    }
Behavior3/5

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

The description mentions that only provided fields will be updated (partial update behavior), which is useful. However, it does not disclose other behavioral aspects like error handling on non-existent IDs, permission requirements, or side effects on related entities. With no annotations, the description carries the full burden, and it partially meets it.

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 extremely concise with two sentences, no redundant information, and the purpose is front-loaded. Every word earns its place.

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?

Given the complexity (6 simple parameters, no output schema), the description is fairly complete. It covers what can be updated and the partial update behavior. It could mention that the task must exist and that the tool likely returns the updated task object, but it is adequate for an update tool.

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

Parameters4/5

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

The input schema has 100% coverage with descriptions for all 6 parameters, so the description does not need to repeat them. However, it adds context by grouping parameters into 'task name, billing settings, and activity status' and clarifies that updates are partial ('Only provided fields will be updated'). This adds value beyond the schema.

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 action ('update') and the resource ('existing task'), and lists the types of fields that can be modified (name, billing settings, activity status). This differentiates it from sibling update tools for other entities.

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 create_task or delete_task. It does not specify prerequisites, such as the task needing to exist, or when it is appropriate to update versus other 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

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/ianaleck/harvest-mcp-server'

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