Skip to main content
Glama
someposer
by someposer

list_tasks_by_project

Retrieve all tasks within a specified project in MCP OmniFocus, filtering by task status if needed, to manage and organize project-related activities efficiently.

Instructions

List all tasks in a specific project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe ID of the project to list tasks for
task_statusNoThe status of the tasks to list. If None, it is the equivelant of requesting available and unblocked tasks ['Available', 'Next', 'Overdue', 'DueSoon'].

Implementation Reference

  • MCP tool handler and registration for 'list_tasks_by_project'. Includes input schema via Annotated Fields and Pydantic, defaults task_status, and delegates execution to omnifocus utility.
    @mcp.tool
    def list_tasks_by_project(
        project_id: Annotated[str, Field(description="The ID of the project to list tasks for")],
        task_status: Annotated[
            list[omnifocus.TaskStatus] | None,
            Field(
                description="The status of the tasks to list. If None, it is the equivelant "
                "of requesting available and unblocked tasks ['Available', 'Next', 'Overdue', 'DueSoon']."
            ),
        ] = None,
    ) -> list[dict[str, str]]:
        """List all tasks in a specific project."""
        if task_status is None:
            task_status = ["Available", "Next", "Overdue", "DueSoon"]
        return omnifocus.list_tasks_by_project(project_id, task_status=task_status)
  • Core implementation of listing tasks by project using JavaScript evaluation in OmniFocus, filtering by task_status, formatting results with helper functions.
    def list_tasks_by_project(project_id: str, task_status: list[TaskStatus] | None = None) -> list[dict[str, str]]:
        """List all tasks in a specific project in OmniFocus.
    
        Args:
            project_id: The ID of the project to filter tasks by.
            task_status: A list of task statuses to filter by. If None, all tasks are returned.
    
        Returns:
            A list of dictionaries containing task names, ids, project ids, and tag ids.
        """
        script = Template(
            dedent("""
        ${__common_functions__}
        
        (() => {
            let project = Project.byIdentifier("${project_id}");
            const allowedStatuses = ${task_status};
    
            if (!project) {
                throw "Could not find project: " + project_id.toString();
            }
    
            return project.tasks
                .filter(task => taskStatusFilter(task, allowedStatuses))
                .map((task) => {
                    try {
                        return formatTask(task);
                    } catch (e) {
                        return null;
                    }
                }).filter(Boolean);
        })();
        """)
        )
    
        return evaluate_javascript(
            script.substitute(
                __common_functions__=__common_functions__,
                project_id=project_id,
                task_status=f"[{', '.join([f'"{status}"' for status in task_status])}]" if task_status else "null",
            )
        )
  • Pydantic/Literal type definition for valid task statuses used in the tool's input parameter.
    TaskStatus = Literal["Available", "Blocked", "Completed", "Dropped", "DueSoon", "Next", "Overdue"]
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. While 'List' implies a read-only operation, it doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what format the output takes. The description lacks crucial behavioral context for a tool with no annotation coverage.

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 that gets straight to the point with zero wasted words. It's appropriately sized for a simple listing tool and front-loads the essential information about what the tool does.

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 tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the output looks like, whether results are filtered/paginated, or any behavioral constraints. While the schema covers parameters well, the overall context for using this tool effectively is incomplete.

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?

With 100% schema description coverage, the schema already documents both parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it mentions 'specific project' which aligns with the project_id parameter but provides no extra context about parameter usage or constraints.

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 verb ('List') and resource ('tasks in a specific project'), making the purpose immediately understandable. It distinguishes from generic 'list_tasks' by specifying the project scope, though it doesn't explicitly differentiate from 'list_tasks_by_tag' which has similar structure but different filtering criteria.

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 'list_tasks' or 'list_tasks_by_tag'. It mentions the project scope but doesn't explain why one would choose this over other listing tools, nor does it mention any prerequisites or exclusions for usage.

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

Related 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/someposer/mcp-omnifocus'

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