Skip to main content
Glama
DiversioTeam

ClickUp MCP Server

by DiversioTeam

log_time

Record time spent on ClickUp tasks to track work hours and maintain accurate project timelines.

Instructions

Log time spent on a task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesTask ID
durationYesDuration (e.g., '2h 30m')
descriptionNoOptional description

Implementation Reference

  • The core handler function for the 'log_time' tool. It resolves the task ID using _resolve_task_id, parses the duration string using parse_duration from utils, constructs a time entry payload, determines the workspace ID if needed, and posts it to the ClickUp time_entries API endpoint.
    async def log_time(
        self,
        task_id: str,
        duration: str,
        description: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Log time spent on a task."""
        try:
            # First resolve the task to get the internal ID
            resolved_task = await self._resolve_task_id(task_id)
            duration_ms = parse_duration(duration)
        except ClickUpAPIError as e:
            return {"error": f"Failed to resolve task '{task_id}': {e!s}"}
    
        # Create time entry
        payload = {
            "duration": duration_ms,
            "task_id": resolved_task.id,
        }
        if description:
            payload["description"] = description
    
        workspace_id = self.client.config.default_workspace_id
        if not workspace_id:
            workspaces = await self.client.get_workspaces()
            workspace_id = workspaces[0].id
    
        await self.client._request("POST", f"/team/{workspace_id}/time_entries", json=payload)
    
        return {
            "logged": True,
            "duration": duration,
            "duration_ms": duration_ms,
            "task_id": resolved_task.id,
        }
  • The JSON schema definition for the 'log_time' tool input, defining properties for task_id (string, required), duration (string, e.g. '2h 30m', required), and optional description (string). Provided via get_tool_definitions().
    Tool(
        name="log_time",
        description="Log time spent on a task",
        inputSchema={
            "type": "object",
            "properties": {
                "task_id": {"type": "string", "description": "Task ID"},
                "duration": {"type": "string", "description": "Duration (e.g., '2h 30m')"},
                "description": {"type": "string", "description": "Optional description"},
            },
            "required": ["task_id", "duration"],
        },
    ),
  • Registration of the 'log_time' handler in the ClickUpTools class's _tools dictionary, mapping the tool name to self.log_time method. Used by call_tool to dispatch invocations.
    self._tools: Dict[str, Callable] = {
        "create_task": self.create_task,
        "get_task": self.get_task,
        "update_task": self.update_task,
        "delete_task": self.delete_task,
        "list_tasks": self.list_tasks,
        "search_tasks": self.search_tasks,
        "get_subtasks": self.get_subtasks,
        "get_task_comments": self.get_task_comments,
        "create_task_comment": self.create_task_comment,
        "get_task_status": self.get_task_status,
        "update_task_status": self.update_task_status,
        "get_assignees": self.get_assignees,
        "assign_task": self.assign_task,
        "list_spaces": self.list_spaces,
        "list_folders": self.list_folders,
        "list_lists": self.list_lists,
        "find_list_by_name": self.find_list_by_name,
        # Bulk operations
        "bulk_update_tasks": self.bulk_update_tasks,
        "bulk_move_tasks": self.bulk_move_tasks,
        # Time tracking
        "get_time_tracked": self.get_time_tracked,
        "log_time": self.log_time,
        # Templates
        "create_task_from_template": self.create_task_from_template,
        "create_task_chain": self.create_task_chain,
        # Analytics
        "get_team_workload": self.get_team_workload,
        "get_task_analytics": self.get_task_analytics,
        # User management
        "list_users": self.list_users,
        "get_current_user": self.get_current_user,
        "find_user_by_name": self.find_user_by_name,
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Log time' implies a write operation, but the description doesn't specify whether this creates new time entries, updates existing ones, requires specific permissions, or has side effects (e.g., affecting task status). It lacks details on response format, error conditions, or idempotency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose, making it easy to parse quickly. Every word earns its place by directly conveying the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool (implied by 'log') with no annotations and no output schema, the description is insufficient. It doesn't cover behavioral aspects like permissions, side effects, or return values, nor does it clarify usage relative to siblings. The high schema coverage helps with parameters, but overall context is incomplete for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear parameter documentation (task_id, duration, description). The description adds no additional semantic context beyond the schema, such as explaining duration format constraints beyond 'e.g., '2h 30m'' or how task_id relates to existing tasks. Baseline 3 is appropriate when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Log time spent on a task' clearly states the verb ('log') and resource ('time spent on a task'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_time_tracked' (which likely retrieves logged time) or explain what 'log' specifically means in this context (e.g., create vs. update).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., task must exist), when not to use it, or how it relates to siblings like 'get_time_tracked' (for reading logged time) or 'update_task' (which might also handle time tracking).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/DiversioTeam/clickup-mcp'

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