Skip to main content
Glama
someposer
by someposer

list_tasks_by_tag

Filter and retrieve OmniFocus tasks by a specific tag ID using MCP OmniFocus. Optionally filter by task status to manage tasks efficiently.

Instructions

List all tasks with a specific tag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tag_idYesThe ID of the tag 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_tag'. Defines input schema via Annotated Fields and delegates execution to the omnifocus utility.
    @mcp.tool
    def list_tasks_by_tag(
        tag_id: Annotated[str, Field(description="The ID of the tag 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 with a specific tag."""
        if task_status is None:
            task_status = ["Available", "Next", "Overdue", "DueSoon"]
        return omnifocus.list_tasks_by_tag(tag_id, task_status=task_status)
  • Core helper function that generates and evaluates JavaScript to retrieve tasks associated with a specific tag from OmniFocus, applying status filters.
    def list_tasks_by_tag(tag_id: str, task_status: list[TaskStatus] | None = None) -> list[dict[str, str]]:
        """List all tasks with a specific tag in OmniFocus.
    
        Args:
            tag_id: The ID of the tag 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 tag = Tag.byIdentifier("${tag_id}");
            const allowedStatuses = ${task_status};
    
            if (!tag) {
                throw "Could not find tag: " + tag_id.toString();
            }
            
            return tag.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__,
                tag_id=tag_id,
                task_status=f"[{', '.join([f'"{status}"' for status in task_status])}]" if task_status else "null",
            )
        )
  • Type alias defining valid TaskStatus values used in the tool's input schema for filtering tasks.
    TaskStatus = Literal["Available", "Blocked", "Completed", "Dropped", "DueSoon", "Next", "Overdue"]
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. While 'List' implies a read-only operation, the description doesn't address critical aspects like authentication requirements, rate limits, pagination behavior, or what happens when no tasks match the tag. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 directly states the tool's function without unnecessary words. It's front-loaded with the core purpose and avoids any redundant or verbose phrasing.

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?

Given the lack of annotations and output schema, the description is incomplete for a tool with two parameters and no structured behavioral hints. It doesn't explain return values, error conditions, or operational constraints, leaving the agent with insufficient context to use the tool effectively beyond basic parameter passing.

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%, so the schema fully documents both parameters (tag_id and task_status). The description adds no additional parameter semantics beyond implying tag-based filtering, which is already clear from the tool name and schema. This 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 verb ('List') and resource ('tasks') with a specific filtering criterion ('with a specific tag'), making the purpose unambiguous. However, it doesn't explicitly distinguish this tool from sibling tools like 'list_tasks' or 'list_tasks_by_project', which would require mentioning the unique tag-based filtering approach.

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 sibling tools like 'list_tasks' (for unfiltered listing) or 'list_tasks_by_project' (for project-based filtering), nor does it specify 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