Skip to main content
Glama

get_tasks

Retrieve tasks from Productive.io with filtering by project, assignee, status, or custom criteria, plus pagination for organized task management.

Instructions

Get tasks with optional filtering and pagination.

Supports filtering by project, assignee, status, and other criteria. All parameters are optional - omit to fetch all tasks.

Example of extra_filters:

  • filter[status][eq]=1: Open tasks

  • filter[status][eq]=2: Closed tasks

  • filter[workflow_status_category_id][eq]=3: Workflow closed status

  • filter[board_status][eq]=1: Active board tasks

Returns: Dictionary of tasks matching the provided filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoFilter tasks by project ID
user_idNoFilter tasks by assignee/user ID
page_numberNoPage number for pagination
page_sizeNoOptional number of tasks per page (max 200)
sortNoSort parameter (e.g., 'last_activity_at', '-last_activity_at', 'created_at', 'due_date'). Use '-' prefix for descending order. Defaults to '-last_activity_at' (most recent first).-last_activity_at
extra_filtersNoAdditional Productive query filters using API syntax. Common filters: filter[status][eq] (1: open, 2: closed), filter[due_date][gte] (date), filter[workflow_status_category_id][eq] (1: not started, 2: started, 3: closed).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • tools.py:51-95 (handler)
    Core handler function that constructs API parameters based on inputs (pagination, sorting, filters), calls ProductiveClient.get_tasks, applies response filtering, handles API errors and logs via MCP Context.
    async def get_tasks(
        ctx: Context,
        page_number: int = None,
        page_size: int = config.items_per_page,
        sort: str = "-last_activity_at",
        project_id: int = None,
        user_id: int = None,
        extra_filters: dict = None
    ) -> ToolResult:
        """
        List tasks with optional filters and pagination.
    
        Developer notes:
        - project_id and user_id are converted to Productive API filters.
        - extra_filters is passed through directly to the API (e.g., filter[status][eq]).
        - Enforces a configurable default page[size] for consistency when not provided.
        - Sort supports Productive's allowed fields (e.g., last_activity_at, created_at, due_date).
        - Response is cleaned with utils.filter_task_list_response (excludes descriptions for lean lists).
        """
        try:
            await ctx.info("Fetching tasks")
            params = {}
            if page_number is not None:
                params["page[number]"] = page_number
            params["page[size]"] = page_size
            if sort:
                params["sort"] = sort
            if project_id is not None:
                params["filter[project_id][eq]"] = project_id
            if user_id is not None:
                params["filter[assignee_id][eq]"] = user_id
            if extra_filters:
                params.update(extra_filters)
    
            result = await client.get_tasks(params=params if params else None)
            await ctx.info("Successfully retrieved tasks")
    
            filtered = filter_task_list_response(result)
            return filtered
    
        except ProductiveAPIError as e:
            await _handle_productive_api_error(ctx, e, "tasks")
        except Exception as e:
            await ctx.error(f"Unexpected error fetching tasks: {str(e)}")
            raise e
  • server.py:202-248 (registration)
    FastMCP tool registration (@mcp.tool) defining the 'get_tasks' tool name, input schema via Annotated[Pydantic Field] parameters with descriptions/validation, and delegation to the implementation in tools.get_tasks.
    async def get_tasks(
        ctx: Context,
        project_id: Annotated[int, Field(description="Filter tasks by project ID")] = None,
        user_id: Annotated[
            int, Field(description="Filter tasks by assignee/user ID")
        ] = None,
        page_number: Annotated[int, Field(description="Page number for pagination")] = None,
        page_size: Annotated[
            int, Field(description="Optional number of tasks per page (max 200)")
        ] = None,
        sort: Annotated[
            str,
            Field(
                description="Sort parameter (e.g., 'last_activity_at', '-last_activity_at', 'created_at', 'due_date'). Use '-' prefix for descending order. Defaults to '-last_activity_at' (most recent first)."
            ),
        ] = "-last_activity_at",
        extra_filters: Annotated[
            dict,
            Field(
                description="Additional Productive query filters using API syntax. Common filters: filter[status][eq] (1: open, 2: closed), filter[due_date][gte] (date), filter[workflow_status_category_id][eq] (1: not started, 2: started, 3: closed)."
            ),
        ] = None,
    ) -> Dict[str, Any]:
        """Get tasks with optional filtering and pagination.
    
        Supports filtering by project, assignee, status, and other criteria.
        All parameters are optional - omit to fetch all tasks.
    
        Example of extra_filters:
        - filter[status][eq]=1: Open tasks
        - filter[status][eq]=2: Closed tasks
        - filter[workflow_status_category_id][eq]=3: Workflow closed status
        - filter[board_status][eq]=1: Active board tasks
    
        Returns:
            Dictionary of tasks matching the provided filters
        """
        return await tools.get_tasks(
            ctx,
            page_number=page_number,
            page_size=page_size,
            sort=sort,
            project_id=project_id,
            user_id=user_id,
            extra_filters=extra_filters,
        )
  • ProductiveClient helper method that performs the actual HTTP API call to GET /tasks, automatically includes workflow_status relation, handles retries/errors.
    async def get_tasks(self, params: Optional[dict] = None) -> Dict[str, Any]:
        """Get all tasks with workflow_status always included
        """
        if params is None:
            params = {}
        params["include"] = "workflow_status"
        return await self._request("GET", "/tasks", params=params)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds some context beyond the input schema by mentioning pagination support and the return format ('Dictionary of tasks matching the provided filters'), but it doesn't cover important aspects like rate limits, authentication needs, or whether this is a read-only operation (though 'Get' implies it). The example of extra_filters provides behavioral insight but is limited.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with the core purpose. The example section is useful but slightly lengthens the text. Most sentences earn their place by clarifying optional parameters and providing filtering examples, though it could be more streamlined.

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

Completeness4/5

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

Given the complexity (6 parameters, nested objects) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers key aspects like filtering, pagination, and optional parameters, but it could improve by addressing behavioral traits like rate limits or authentication, especially since no annotations are provided.

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 schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by listing filterable criteria (project, assignee, status) and noting that parameters are optional, but it doesn't provide additional syntax or format details. The example of extra_filters offers some semantic clarification, but overall, the description meets the baseline for high schema coverage.

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 clearly states the tool's purpose as 'Get tasks with optional filtering and pagination,' which is a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from its sibling 'get_task' (singular), which might retrieve a single task, leaving some ambiguity about when to use each.

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

Usage Guidelines3/5

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

The description provides implied usage guidance by stating 'All parameters are optional - omit to fetch all tasks,' which suggests when to use default behavior. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_task' (singular) or 'quick_search,' and doesn't mention any prerequisites or exclusions.

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/druellan/Productive-GET-MCP'

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