Skip to main content
Glama
mdoel
by mdoel

get_all_projects

Retrieve a complete list of all projects from OmniFocus, including completed and dropped ones, for comprehensive task management and review.

Instructions

Call this tool to get a list of all projects from OmniFocus, including completed and dropped ones. Use it when the user explicitly asks for 'all projects'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes the tool logic: builds JXA script for all projects, runs it via osascript, parses JSON output.
    async getAllProjects(): Promise<any[]> {
      console.error('[DEBUG] getAllProjects called');
      const jxaScript = buildJxaScriptForProjects(false);
      const output = this.executeScript(jxaScript);
      try {
        const projects = JSON.parse(output);
        return projects;
      } catch (e) {
        console.error('[DEBUG] Failed to parse OmniFocus JXA output:', output);
        throw new Error('Failed to parse OmniFocus output as JSON');
      }
    }
  • src/server.ts:61-65 (registration)
    MCP tool registration in listTools handler: defines name, description, and input schema (no parameters).
    {
      name: 'get_all_projects',
      description: "Call this tool to get a list of all projects from OmniFocus, including completed and dropped ones. Use it when the user explicitly asks for 'all projects'.",
      inputSchema: { type: 'object', properties: {} }
    },
  • Server-side dispatch handler for the tool call, delegates to OmniFocusClient.getAllProjects().
    case 'get_all_projects':
      result = await this.client.getAllProjects();
      break;
  • Helper function that generates the JXA (JavaScript for Automation) script executed in OmniFocus to retrieve all projects data as JSON.
    export function buildJxaScriptForProjects(activeOnly: boolean): string {
      return `
        (() => {
          const app = Application('OmniFocus');
          app.includeStandardAdditions = true;
          const ofDoc = app.defaultDocument;
          function safe(obj, method) {
            try { return obj && typeof obj[method] === 'function' ? obj[method]() : null; } catch { return null; }
          }
          function isInTemplatesFolder(project) {
            let folder = safe(project, 'folder');
            while (folder) {
              if (safe(folder, 'name') === 'Templates') return true;
              folder = safe(folder, 'parentFolder');
            }
            return false;
          }
          function isExcludedProject(project) {
            const name = safe(project, 'name') || '';
            if (name.includes('«') || name.includes('»')) return true;
            if (name.includes('⚙️')) return true;
            return isInTemplatesFolder(project);
          }
          function getProjectData(project) {
            return {
              id: safe(project, 'id'),
              name: safe(project, 'name'),
              note: safe(project, 'note'),
              completed: safe(project, 'completed'),
              status: safe(project, 'status'),
              flagged: safe(project, 'flagged'),
              folder: (function() {
                const folder = safe(project, 'folder');
                return folder ? { id: safe(folder, 'id'), name: safe(folder, 'name') } : null;
              })(),
            };
          }
          const allProjects = Array.from(ofDoc.flattenedProjects());
          const filteredProjects = allProjects.filter(project => {
            if (isExcludedProject(project)) return false;
            // No activeOnly filtering here; always return all projects
            return true;
          });
          const result = filteredProjects.map(getProjectData);
          return JSON.stringify(result);
        })();
      `;
    } 
  • TypeScript interface defining the structure of OmniFocusProject objects returned by the tool.
    export interface OmniFocusProject {
      id: string;
      name: string;
      note: string;
      status: 'active' | 'on-hold' | 'completed' | 'dropped';
      completionDate?: string;
      creationDate: string;
      modificationDate: string;
      dueDate?: string;
      deferDate?: string;
      sequential: boolean;
      singleton: boolean;
      containingFolder?: {
        id: string;
        name: string;
      };
    }
Behavior3/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 clearly indicates this is a read operation ('get a list'), but doesn't mention potential limitations like rate limits, authentication requirements, or response format details. The description adds basic context about what data is included but lacks richer behavioral information.

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 consists of two focused sentences with zero wasted words. The first sentence establishes purpose and scope, the second provides clear usage guidance. Every element serves a specific function, making it efficiently structured and appropriately sized for its complexity level.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with zero parameters and no output schema, the description provides adequate context: purpose, scope, and usage guidance. However, without annotations or output schema, it could benefit from mentioning what the return format looks like (e.g., list structure, fields included) to be fully complete for agent consumption.

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 tool has zero parameters, and schema description coverage is 100% (though empty). The description appropriately doesn't discuss parameters since none exist, which is correct for a parameterless tool. No additional parameter semantics are needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('get a list of all projects') and resource ('from OmniFocus'), with explicit scope differentiation ('including completed and dropped ones'). It directly distinguishes this tool from its sibling 'get_active_projects' by specifying it returns all projects rather than just active ones.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Use it when the user explicitly asks for 'all projects''. This creates a clear boundary for when to select this tool versus its siblings (like 'get_active_projects'), effectively telling the agent when this specific tool is appropriate.

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

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

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