Skip to main content
Glama

filter_tasks_tool

Filter tasks by status, title, description, or creation date to find specific items in your task list.

Instructions

Filter tasks by status and title. Args: status (TaskStatus): The status to filter tasks. Optional value. title (str): The title to filter tasks. Optional value. description (str): The description to filter tasks. Optional value. created_at (str): The creation date to filter tasks. Optional value.

Returns: list[Task]: A list of tasks matching the specified status and title.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNo
titleNo
descriptionNo
created_atNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'filter_tasks_tool' tool. It uses the database to filter tasks based on optional criteria (status, title, description, created_at) and returns a list of Task objects.
    @mcp.tool()
    async def filter_tasks_tool(
        ctx: Context[ServerSession, AppContext],
        status: TaskStatus | None = None,
        title: str | None = None,
        description: str | None = None,
        created_at: str | None = None,
    ) -> list[Task]:
        """Filter tasks by status and title.
        Args:
            status (TaskStatus): The status to filter tasks. Optional value.
            title (str): The title to filter tasks. Optional value.
            description (str): The description to filter tasks. Optional value.
            created_at (str): The creation date to filter tasks. Optional value.
    
        Returns:
            list[Task]: A list of tasks matching the specified status and title.
        """
        database: DatabaseABC = ctx.request_context.lifespan_context.db
        tasks = database.filter_tasks(
            title=title or "",
            description=description or "",
            status=status if status is not None else None,
            created_at=created_at or "",
        )
        return [Task(**task.__dict__) for task in tasks]
  • Pydantic models defining TaskStatus enum (used in tool input) and Task model (used for output serialization of filtered tasks).
    from enum import IntEnum
    
    from pydantic import BaseModel, Field
    
    
    class TaskStatus(IntEnum):
        CREATED = 0
        IN_PROGRESS = 1
        COMPLETED = 2
    
    
    class Task(BaseModel):
        id: int = Field(default=None)
        title: str = Field(..., description="The title of the task")
        description: str = Field(default="", description="The description of the task")
        status: TaskStatus = TaskStatus.CREATED
        created_at: str = Field(default=None)
  • The registration of the filter_tasks_tool occurs via the call to create_tasks_tools(mcp), which defines and registers all task-related tools including filter_tasks_tool.
    create_tasks_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool returns 'A list of tasks matching the specified status and title' but doesn't mention whether all filters are AND/OR combined, what happens when no filters are provided, pagination behavior, error conditions, or performance characteristics. For a filtering tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 well-structured with clear sections (purpose, args, returns). It's appropriately sized for a filtering tool. However, the purpose statement mentions only two filter criteria while the tool actually supports four, creating a minor inconsistency. The 'Args' section could be more efficiently integrated.

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 has an output schema (list[Task]), the description doesn't need to explain return values in detail. However, with no annotations, 4 parameters at 0% schema coverage, and multiple sibling tools, the description should provide more context about filtering logic, performance, and differentiation from alternatives. It's minimally adequate but leaves important questions unanswered.

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 0%, so the description must compensate. It lists all four parameters with brief explanations, but provides minimal semantic context. It doesn't explain what TaskStatus enum values mean (0, 1, 2), date format for 'created_at', or how string matching works for 'title' and 'description'. The description adds basic parameter identification but lacks meaningful semantic details.

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: 'Filter tasks by status and title.' It specifies the verb ('filter') and resource ('tasks'), though it mentions only two filter criteria in the purpose statement while the actual implementation includes four. It distinguishes from siblings like 'get_tasks_status' or 'tasks_list_tool' by emphasizing filtering capabilities.

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 like 'get_tasks_status' or 'tasks_list_tool'. It doesn't mention prerequisites, performance considerations, or typical use cases. The agent must infer usage from the tool name and parameters alone.

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/chipocrudos/tasks-mcp'

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