Skip to main content
Glama

update_task

Modify existing tasks in Harvest time tracking by updating name, billing settings, or activity status with only the fields you specify.

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 handler class UpdateTaskHandler contains the logic to execute the 'update_task' tool by calling the Harvest API.
    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 registration of the 'update_task' tool in the registerTaskTools function, linking it to the 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),
    },

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