Skip to main content
Glama

add_project

Create and manage new projects in OmniFocus by specifying details such as name, due date, notes, tags, and folder assignment. Organize tasks efficiently with customizable settings like sequential order and estimated time.

Instructions

Add a new project to OmniFocus

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deferDateNoThe defer date of the project in ISO format (YYYY-MM-DD or full ISO date)
dueDateNoThe due date of the project in ISO format (YYYY-MM-DD or full ISO date)
estimatedMinutesNoEstimated time to complete the project, in minutes
flaggedNoWhether the project is flagged or not
folderNameNoThe name of the folder to add the project to (will add to root if not specified)
nameYesThe name of the project
noteNoAdditional notes for the project
sequentialNoWhether tasks in the project should be sequential (default: false)
tagsNoTags to assign to the project

Implementation Reference

  • src/server.ts:39-44 (registration)
    Registers the 'add_project' MCP tool, providing the name, description, input schema, and handler function.
    server.tool(
      "add_project",
      "Add a new project to OmniFocus",
      addProjectTool.schema.shape,
      addProjectTool.handler
    );
  • Zod schema defining the input parameters for the add_project tool.
    export const schema = z.object({
      name: z.string().describe("The name of the project"),
      note: z.string().optional().describe("Additional notes for the project"),
      dueDate: z.string().optional().describe("The due date of the project in ISO format (YYYY-MM-DD or full ISO date)"),
      deferDate: z.string().optional().describe("The defer date of the project in ISO format (YYYY-MM-DD or full ISO date)"),
      flagged: z.boolean().optional().describe("Whether the project is flagged or not"),
      estimatedMinutes: z.number().optional().describe("Estimated time to complete the project, in minutes"),
      tags: z.array(z.string()).optional().describe("Tags to assign to the project"),
      folderName: z.string().optional().describe("The name of the folder to add the project to (will add to root if not specified)"),
      sequential: z.boolean().optional().describe("Whether tasks in the project should be sequential (default: false)")
    });
  • The main handler function for the add_project tool. Validates input via schema, calls the primitive addProject function, and formats success/error responses.
    export async function handler(args: z.infer<typeof schema>, extra: RequestHandlerExtra) {
      try {
        // Call the addProject function 
        const result = await addProject(args as AddProjectParams);
        
        if (result.success) {
          // Project was added successfully
          let locationText = args.folderName 
            ? `in folder "${args.folderName}"` 
            : "at the root level";
            
          let tagText = args.tags && args.tags.length > 0
            ? ` with tags: ${args.tags.join(', ')}`
            : "";
            
          let dueDateText = args.dueDate
            ? ` due on ${new Date(args.dueDate).toLocaleDateString()}`
            : "";
            
          let sequentialText = args.sequential
            ? " (sequential)"
            : " (parallel)";
            
          return {
            content: [{
              type: "text" as const,
              text: `✅ Project "${args.name}" created successfully ${locationText}${dueDateText}${tagText}${sequentialText}.`
            }]
          };
        } else {
          // Project creation failed
          return {
            content: [{
              type: "text" as const,
              text: `Failed to create project: ${result.error}`
            }],
            isError: true
          };
        }
      } catch (err: unknown) {
        const error = err as Error;
        console.error(`Tool execution error: ${error.message}`);
        return {
          content: [{
            type: "text" as const,
            text: `Error creating project: ${error.message}`
          }],
          isError: true
        };
      }
    } 
  • Core implementation of project addition: generates AppleScript to interact with OmniFocus via osascript and parses the result.
    export async function addProject(params: AddProjectParams): Promise<{success: boolean, projectId?: string, error?: string}> {
      try {
        // Generate AppleScript
        const script = generateAppleScript(params);
        
        console.error("Executing AppleScript directly...");
        
        // Execute AppleScript directly
        const { stdout, stderr } = await execAsync(`osascript -e '${script}'`);
        
        if (stderr) {
          console.error("AppleScript stderr:", stderr);
        }
        
        console.error("AppleScript stdout:", stdout);
        
        // Parse the result
        try {
          const result = JSON.parse(stdout);
          
          // Return the result
          return {
            success: result.success,
            projectId: result.projectId,
            error: result.error
          };
        } catch (parseError) {
          console.error("Error parsing AppleScript result:", parseError);
          return {
            success: false,
            error: `Failed to parse result: ${stdout}`
          };
        }
      } catch (error: any) {
        console.error("Error in addProject:", error);
        return {
          success: false,
          error: error?.message || "Unknown error in addProject"
        };
      }
    } 
  • TypeScript interface defining parameters for the primitive addProject function, matching the tool schema.
    export interface AddProjectParams {
      name: string;
      note?: string;
      dueDate?: string; // ISO date string
      deferDate?: string; // ISO date string
      flagged?: boolean;
      estimatedMinutes?: number;
      tags?: string[]; // Tag names
      folderName?: string; // Folder name to add project to
      sequential?: boolean; // Whether tasks should be sequential or parallel
    }
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 but only states the basic action. It doesn't mention what happens on success/failure, whether the operation is idempotent, permission requirements, rate limits, or any side effects. For a creation tool with zero annotation coverage, this leaves critical behavioral aspects undocumented.

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, clear sentence with no wasted words. It's appropriately sized for a tool with good schema documentation and gets straight to the point without unnecessary elaboration.

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 creation tool with 9 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what constitutes a valid project, how the system responds, error conditions, or relationships with sibling tools. The agent would need to infer too much from the minimal description alone.

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?

The schema has 100% description coverage, so all parameters are documented in the structured schema. The description adds no additional parameter information beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

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 ('Add a new project') and the target resource ('to OmniFocus'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'add_omnifocus_task', which creates ambiguity about when to use one versus the other for project-related operations.

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 'add_omnifocus_task' or 'batch_add_items'. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent to guess based on tool names 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

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/themotionmachine/OmniFocus-MCP'

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