Skip to main content
Glama
DiversioTeam

ClickUp MCP Server

by DiversioTeam

search_tasks

Find tasks in ClickUp by query, status, or assignee to manage project workflows effectively.

Instructions

Search tasks across workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch query
statusesNoFilter by statuses
assigneesNoFilter by assignee IDs

Implementation Reference

  • Implementation of the search_tasks tool handler. Calls the ClickUp client's search_tasks method and formats the response with task details including ID, name, status, list, space, and URL.
    async def search_tasks(
        self,
        query: Optional[str] = None,
        statuses: Optional[List[str]] = None,
        assignees: Optional[List[int]] = None,
        **kwargs: Any,
    ) -> Dict[str, Any]:
        """Search tasks."""
        tasks = await self.client.search_tasks(
            query=query,
            statuses=statuses,
            assignees=assignees,
        )
    
        return {
            "tasks": [
                {
                    "id": task.id,
                    "name": task.name,
                    "status": task.status.status,
                    "list": task.list.get("name", "Unknown"),
                    "space": task.space.get("name", "Unknown"),
                    "url": format_task_url(task.id),
                }
                for task in tasks
            ],
            "count": len(tasks),
        }
  • Input schema definition for the search_tasks tool, defining parameters like query, statuses, and assignees.
    Tool(
        name="search_tasks",
        description="Search tasks across workspace",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {"type": "string", "description": "Search query"},
                "statuses": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Filter by statuses",
                },
                "assignees": {
                    "type": "array",
                    "items": {"type": "integer"},
                    "description": "Filter by assignee IDs",
                },
            },
        },
    ),
  • Registration of the search_tasks handler in the _tools dictionary used by call_tool method.
    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,
    }
  • MCP server handler for listing tools, which returns definitions including search_tasks from ClickUpTools.
    @self.server.list_tools()
    async def list_tools() -> List[Tool]:
        """List all available tools."""
        return self.tools.get_tool_definitions()
  • Underlying ClickUpClient method that performs the API search for tasks, called by the tool handler.
    async def search_tasks(
        self,
        workspace_id: Optional[str] = None,
        query: Optional[str] = None,
        statuses: Optional[List[str]] = None,
        assignees: Optional[List[int]] = None,
        tags: Optional[List[str]] = None,
        date_created_gt: Optional[int] = None,
        date_created_lt: Optional[int] = None,
        date_updated_gt: Optional[int] = None,
        date_updated_lt: Optional[int] = None,
    ) -> List[Task]:
        """Search tasks across the workspace."""
        workspace_id = workspace_id or self.config.default_workspace_id
        if not workspace_id:
            workspaces = await self.get_workspaces()
            if not workspaces:
                raise ClickUpAPIError("No workspaces found")
            workspace_id = workspaces[0].id
    
        params: Dict[str, Any] = {}
    
        if query:
            params["query"] = query
        if statuses:
            params["statuses[]"] = statuses
        if assignees:
            params["assignees[]"] = assignees
        if tags:
            params["tags[]"] = tags
        if date_created_gt:
            params["date_created_gt"] = str(date_created_gt)
        if date_created_lt:
            params["date_created_lt"] = str(date_created_lt)
        if date_updated_gt:
            params["date_updated_gt"] = str(date_updated_gt)
        if date_updated_lt:
            params["date_updated_lt"] = str(date_updated_lt)
    
        data = await self._request(
            "GET",
            f"/team/{workspace_id}/task",
            params=params,
        )
        tasks = data.get("tasks", [])
        return [Task(**task) for task in tasks]
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'search' but doesn't disclose behavioral traits like whether it's read-only (implied but not explicit), pagination, rate limits, authentication needs, or what happens on no results. For a search tool with zero annotation coverage, this is a significant gap in transparency.

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 waste. It's front-loaded and appropriately sized for a search tool, making it easy for an agent to parse quickly without unnecessary detail.

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

Completeness3/5

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

Given the tool's moderate complexity (search with filters), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, or error handling. With schema coverage at 100%, it meets a baseline but doesn't fully compensate for missing annotations and output schema.

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?

Schema description coverage is 100%, with clear descriptions for 'query', 'statuses', and 'assignees'. The description adds no additional parameter semantics beyond what the schema provides, such as query syntax examples or status/assignee formats. Baseline 3 is appropriate as the schema does the heavy lifting.

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 'Search tasks across workspace' clearly states the action (search) and resource (tasks) with scope (across workspace). It distinguishes from siblings like 'list_tasks' (which presumably lists without search) and 'get_task' (which retrieves a specific task). However, it doesn't specify what makes this search unique compared to other search-like siblings (none explicitly listed), keeping it from a perfect 5.

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 when to prefer this over 'list_tasks' (e.g., for filtered queries) or 'get_task' (for specific IDs), nor does it specify prerequisites or exclusions. This lack of context leaves the agent without usage direction.

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