Skip to main content
Glama
someposer
by someposer

create_task

Automate task creation in OmniFocus by defining a name and optional note. Streamline task management using MCP OmniFocus server for integration with VS Code, command line, or MCP-compatible clients.

Instructions

Create a new task in OmniFocus with a name and an optional note.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the task to create
noteNoThe note for the task, None if no note

Implementation Reference

  • FastMCP tool handler, registration, and schema definition for the 'create_task' tool. Delegates implementation to omnifocus utility.
    @mcp.tool
    def create_task(
        name: Annotated[str, Field(description="The name of the task to create")],
        note: Annotated[str | None, Field(description="The note for the task, None if no note")] = None,
    ) -> dict[str, str]:
        """Create a new task in OmniFocus with a name and an optional note."""
        return omnifocus.create_task(task_name=name, task_note=note)
  • Helper utility that executes JavaScript in OmniFocus to create a new task with name and optional note, then formats and returns task details.
    def create_task(task_name: str, task_note: str | None = None) -> dict[str, str]:
        """Create a new task in OmniFocus.
    
        Args:
            task_name: The name of the task to create.
            task_note: An optional note for the task.
    
        Returns:
            A dictionary containing the created task's details.
        """
        script = Template(
            dedent("""
        ${__common_functions__}
        
        (() => {
            let task = new Task("${task_name}");
            let task_note = ${task_note};
            if (task_note) {
                task.note = task_note;
            }
            return formatTask(task);
        })();
        """)
        )
    
        return evaluate_javascript(
            script.substitute(
                __common_functions__=__common_functions__,
                task_name=task_name,
                task_note=f'"{task_note}"' if task_note else "null",
            )
        )
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