Skip to main content
Glama
someposer
by someposer

list_inbox

Retrieve and display all tasks currently in your OmniFocus Inbox using an MCP server. Simplify task management by accessing your inbox directly from compatible clients like VS Code or the command line.

Instructions

List all tasks in the OmniFocus Inbox.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool that defines and registers the list_inbox tool. It delegates to omnifocus.list_perspective_tasks("Inbox").
    @mcp.tool
    def list_inbox() -> list[dict[str, str]]:
        """List all tasks in the OmniFocus Inbox."""
        return omnifocus.list_perspective_tasks("Inbox")
  • Core helper function implementing the logic to list tasks from a specific OmniFocus perspective ('Inbox' for list_inbox) using JXA script execution.
    def list_perspective_tasks(perspective_name: str) -> list[dict[str, str]]:
        """List all tasks in a specific perspective in OmniFocus.
    
        Args:
            perspective_name: The name of the perspective to filter tasks by.
    
        Returns:
            A list of dictionaries containing task names, ids, project ids, and tag ids.
        """
        script = Template(
            dedent("""
        ${__common_functions__}                            
    
        (() => {
            let perspective = getPerspectiveByName("${perspective_name}");
    
            if (!perspective) {
                throw "Could not find perspective: " + perspective_name.toString();
            }
    
            win = document.windows[0];
            win.perspective = perspective;
    
            if (perspective == Perspective.BuiltIn.Forecast) {
                var now = new Date();
                var today = Calendar.current.startOfDay(now);
                var dc = new DateComponents();
                dc.day = -1;
                var yesterday = Calendar.current.dateByAddingDateComponents(today, dc);
                win.selectForecastDays([win.forecastDayForDate(yesterday), win.forecastDayForDate(today)]);
            }
    
            return getLeafNodes(win.content.rootNode).map((l) => {
                const task = l.object;
                try {
                    return formatTask(task);
                } catch (e) {
                    return null;
                }
            }).filter(Boolean);
    
        })();
        """)
        )
    
        return evaluate_javascript(
            script.substitute(__common_functions__=__common_functions__, perspective_name=perspective_name)
        )
  • Utility function to evaluate JavaScript in OmniFocus via AppleScript JXA, used by list_perspective_tasks.
    def evaluate_javascript(script: str) -> Any:
        """Execute a JavaScript script in OmniFocus.
    
        See; https://www.omni-automation.com/omnifocus/index.html
    
        Args:
            script: The JavaScript code to execute.
    
        Returns:
            The output of the script as a string.
        """
        jxa_script = f'let script = `{script}`;\n(() => {{\n   return JSON.stringify(Application("OmniFocus").evaluateJavascript(script));\n}})();'
    
        output = run_jxa_script(jxa_script)
        return json.loads(output) if output else {}
  • Common JavaScript functions used in the JXA scripts for task formatting, status mapping, perspective lookup, etc., injected into list_perspective_tasks script.
    __common_functions__ = dedent("""
    function projectStatusToString(status) {
        // Handle null/undefined cases
        if (!status) {
            return 'Unknown';
        }
        
        // Map of status objects to their string representations
        const statusMap = {
            [Project.Status.Active]: 'Active',
            [Project.Status.Done]: 'Done', 
            [Project.Status.Dropped]: 'Dropped',
            [Project.Status.OnHold]: 'OnHold',
        };
        
        // Return the corresponding string or 'Unknown' if not found
        return statusMap[status] || 'Unknown';
    }
                                  
    function taskStatusToString(status) {
        // Handle null/undefined cases
        if (!status) {
            return 'Unknown';
        }
        
        // Map of status objects to their string representations
        const statusMap = {
            [Task.Status.Available]: 'Available',
            [Task.Status.Blocked]: 'Blocked', 
            [Task.Status.Completed]: 'Completed',
            [Task.Status.Dropped]: 'Dropped',
            [Task.Status.DueSoon]: 'DueSoon',
            [Task.Status.Next]: 'Next',
            [Task.Status.Overdue]: 'Overdue'
        };
        
        // Return the corresponding string or 'Unknown' if not found
        return statusMap[status] || 'Unknown';
    }
                                  
    function getFullTagName(tag) {
        const names = [];
        let currentTag = tag;
        // Traverse up the hierarchy
        while (currentTag) {
            names.unshift(currentTag.name);
            try {
                currentTag = currentTag.parent;
            } catch (e) {
                break;  // If we can't access parent, stop traversing
            }
        }
        return names.join(' : ');
    };
                                  
    function getLeafNodes(node) {
        if (!node.children || node.children.length === 0) {
            return [node];
        }
        return node.children.flatMap(getLeafNodes);
    }
    
    function getPerspectiveByName(name) {
        let perspectives = new Array()
        perspectives = perspectives.concat(Perspective.BuiltIn.all)
        perspectives = perspectives.concat(Perspective.Custom.all)
        perspectiveNames = perspectives.map(perspective => perspective.name.toUpperCase())
    
        return perspectives[perspectiveNames.indexOf(name.toUpperCase())] || null;
    }
                                  
    function formatTask(task) {
        return {
            id: task.id.primaryKey,
            name: task.name,
            projectName: task.containingProject ? task.containingProject.name : null,
            status: taskStatusToString(task.taskStatus),
            flagged: task.flagged,
            deferDate: task.deferDate ? task.deferDate.toString() : null,
            dueDate: task.dueDate ? task.dueDate.toString() : null,
            dropped: task.dropped,
            completed: task.completed,
            tags: task.tags ? task.tags.map(tt => tt.name) : [],
            note: task.note
        };
    }
                                  
    function taskStatusFilter(task, allowedStatuses) {
        if (!allowedStatuses || allowedStatuses.length === 0) {
            return true;
        }
        return allowedStatuses.includes(taskStatusToString(task.taskStatus));
    }
    """)
Behavior2/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 states the action but does not cover aspects like whether this is a read-only operation, potential rate limits, authentication needs, or what the return format might be. This leaves significant gaps for a tool with zero 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 directly states the tool's purpose without any unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured.

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 no output schema, the description is incomplete. It does not explain behavioral traits, return values, or usage context, which are crucial for an AI agent to effectively invoke this tool. The simplicity of the tool (0 parameters) does not compensate for these missing elements.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description appropriately does not add parameter details, and since there are no parameters, it meets the baseline expectation without requiring compensation for gaps.

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 action ('List') and resource ('tasks in the OmniFocus Inbox'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'list_tasks', which might list tasks more broadly, leaving room for ambiguity in sibling differentiation.

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, such as 'list_tasks' or other list-related siblings. It lacks context on prerequisites, exclusions, or specific scenarios for usage, offering minimal direction for an AI agent.

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