Skip to main content
Glama

create_task

Add a new task to a project in Clockify by specifying workspace ID, project ID, and task name. Optionally include assignees, time estimates, and task status for better project organization.

Instructions

Create a new task in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneeIdsNoArray of assignee user IDs (optional)
estimateNoTask estimate (ISO 8601 duration, optional)
nameYesTask name
projectIdYesProject ID
statusNoTask status (optional)
workspaceIdYesWorkspace ID

Implementation Reference

  • The main handler function for the 'create_task' tool. It extracts parameters from args, makes a POST request to the Clockify API endpoint `/workspaces/{workspaceId}/projects/{projectId}/tasks` with the task data, and returns a success message with the created 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, }; }
  • Input schema definition for the 'create_task' tool, specifying the required and optional parameters with their types and descriptions.
    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:475-489 (registration)
    Registration of the 'create_task' tool in the server's tool list returned by ListToolsRequestSchema, including name, description, and input schema.
    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:768-770 (registration)
    Dispatch case in the CallToolRequestSchema handler that validates parameters and invokes 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);
  • TypeScript interface defining the structure of a Task object, used for type safety in task-related operations.
    interface Task { id?: string; name: string; projectId: string; assigneeIds?: string[]; estimate?: string; status?: "ACTIVE" | "DONE"; }

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/ratheesh-aot/clockify-mcp'

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