Skip to main content
Glama

OmniFocus-MCP

listPerspectives.ts1.44 kB
import { executeOmniFocusScript } from '../../utils/scriptExecution.js'; import { OmnifocusPerspective } from '../../types.js'; export interface ListPerspectivesParams { includeBuiltIn?: boolean; includeCustom?: boolean; } interface ListPerspectivesResult { success: boolean; perspectives?: OmnifocusPerspective[]; error?: string; } export async function listPerspectives(params: ListPerspectivesParams = {}): Promise<ListPerspectivesResult> { const { includeBuiltIn = true, includeCustom = true } = params; try { // Execute the OmniJS script to list perspectives // This uses the built-in OmniFocus JavaScript API const result = await executeOmniFocusScript('@listPerspectives.js'); if (result.error) { return { success: false, error: result.error }; } // Filter perspectives based on parameters let perspectives = result.perspectives || []; if (!includeBuiltIn) { perspectives = perspectives.filter((p: any) => p.type !== 'builtin'); } if (!includeCustom) { perspectives = perspectives.filter((p: any) => p.type !== 'custom'); } return { success: true, perspectives: perspectives }; } catch (error) { console.error('Error listing perspectives:', error); return { success: false, error: error instanceof Error ? error.message : 'Unknown error occurred' }; } }

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