Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

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
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
projectIdYesProject ID
nameYesTask name
assigneeIdsNoArray of assignee user IDs (optional)
estimateNoTask estimate (ISO 8601 duration, optional)
statusNoTask status (optional)

Implementation Reference

  • 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"],
      },
    },
  • 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"],

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