create_task
Add a new task to a Clockify project with details like name, assignees, estimates, and status for time tracking and project management.
Instructions
Create a new task in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| projectId | Yes | Project ID | |
| name | Yes | Task name | |
| assigneeIds | No | Array of assignee user IDs (optional) | |
| estimate | No | Task estimate (ISO 8601 duration, optional) | |
| status | No | Task status (optional) |
Implementation Reference
- src/index.ts:1134-1152 (handler)The main handler function for the 'create_task' tool. It extracts parameters, makes a POST request to the Clockify API to create a task in the specified project, and returns a formatted success message with task details.private async createTask(args: any) { const { workspaceId, projectId, ...taskData } = args; const task = await this.makeRequest( `/workspaces/${workspaceId}/projects/${projectId}/tasks`, "POST", taskData ); return { content: [ { type: "text", text: `Task created successfully!\nID: ${task.id}\nName: ${task.name}\nProject: ${projectId}\nStatus: ${task.status}\nEstimate: ${task.estimate || "No estimate"}`, }, ], isError: false, }; }
- src/index.ts:768-770 (registration)Registers the tool handler in the CallToolRequestSchema switch statement by routing calls to 'create_task' to the createTask method.case "create_task": if (!args?.workspaceId || !args?.projectId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and projectId are required'); return await this.createTask(args as any);
- src/index.ts:475-489 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and input schema definition.name: "create_task", description: "Create a new task in a project", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, projectId: { type: "string", description: "Project ID" }, name: { type: "string", description: "Task name" }, assigneeIds: { type: "array", items: { type: "string" }, description: "Array of assignee user IDs (optional)" }, estimate: { type: "string", description: "Task estimate (ISO 8601 duration, optional)" }, status: { type: "string", enum: ["ACTIVE", "DONE"], description: "Task status (optional)" }, }, required: ["workspaceId", "projectId", "name"], }, },
- src/index.ts:477-487 (schema)Input schema defining parameters for the create_task tool.inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, projectId: { type: "string", description: "Project ID" }, name: { type: "string", description: "Task name" }, assigneeIds: { type: "array", items: { type: "string" }, description: "Array of assignee user IDs (optional)" }, estimate: { type: "string", description: "Task estimate (ISO 8601 duration, optional)" }, status: { type: "string", enum: ["ACTIVE", "DONE"], description: "Task status (optional)" }, }, required: ["workspaceId", "projectId", "name"],