Skip to main content
Glama

create_project_task_assignment

Assign tasks to projects for time tracking with project-specific rates and budgets.

Instructions

Assign a task to a project, making it available for time tracking on that project. Allows setting project-specific rates and budgets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project ID to assign the task to (required)
task_idYesThe task ID to assign (required)
is_activeNoWhether this assignment is active
billableNoWhether time tracked on this task is billable
hourly_rateNoHourly rate for this task on this project
budgetNoBudget allocation for this task

Implementation Reference

  • The handler for creating a project task assignment, using the Harvest API client.
    class CreateProjectTaskAssignmentHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(CreateProjectTaskAssignmentSchema, args, 'create project task assignment');
          logger.info('Creating project task assignment via Harvest API', { projectId: validatedArgs.project_id, taskId: validatedArgs.task_id });
          const assignment = await this.config.harvestClient.createProjectTaskAssignment(validatedArgs.project_id, validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(assignment, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'create_project_task_assignment');
        }
      }
    }
  • Input validation schema for the create_project_task_assignment tool.
    export const CreateProjectTaskAssignmentSchema = z.object({
      project_id: z.number().int().positive(),
      task_id: z.number().int().positive(),
      is_active: z.boolean().optional().default(true),
      billable: z.boolean().optional().default(true),
      hourly_rate: z.number().min(0).optional(),
      budget: z.number().min(0).optional(),
    });
  • Tool registration for create_project_task_assignment.
    {
      tool: {
        name: 'create_project_task_assignment',
        description: 'Assign a task to a project, making it available for time tracking on that project. Allows setting project-specific rates and budgets.',
        inputSchema: {
          type: 'object',
          properties: {
            project_id: { type: 'number', description: 'The project ID to assign the task to (required)' },
            task_id: { type: 'number', description: 'The task ID to assign (required)' },
            is_active: { type: 'boolean', description: 'Whether this assignment is active' },
            billable: { type: 'boolean', description: 'Whether time tracked on this task is billable' },
            hourly_rate: { type: 'number', minimum: 0, description: 'Hourly rate for this task on this project' },
            budget: { type: 'number', minimum: 0, description: 'Budget allocation for this task' },
          },
          required: ['project_id', 'task_id'],
          additionalProperties: false,
        },
      },
      handler: new CreateProjectTaskAssignmentHandler(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