Skip to main content
Glama

OmniFocus MCP Enhanced

by jqlts1
getCustomPerspectiveTasks.ts1.69 kB
import { z } from 'zod'; import { getCustomPerspectiveTasks } from '../primitives/getCustomPerspectiveTasks.js'; import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js'; export const schema = z.object({ perspectiveName: z.string().describe("Exact name of the OmniFocus custom perspective (e.g., '今日工作安排', '今日复盘', '本周项目'). This is NOT a tag name."), hideCompleted: z.boolean().optional().describe("Whether to hide completed tasks. Set to false to show all tasks including completed ones (default: true)"), limit: z.number().optional().describe("Maximum number of tasks to return in flat view mode (default: 1000, ignored in hierarchy mode)"), showHierarchy: z.boolean().optional().describe("Display tasks in hierarchical tree structure showing parent-child relationships. Use this when user wants '层级显示' or 'tree view' (default: false)") }); export async function handler(args: z.infer<typeof schema>, extra: RequestHandlerExtra) { try { const result = await getCustomPerspectiveTasks({ perspectiveName: args.perspectiveName, hideCompleted: args.hideCompleted !== false, // Default to true limit: args.limit || 1000, showHierarchy: args.showHierarchy || false // Default to false }); return { content: [{ type: "text" as const, text: result }] }; } catch (err: unknown) { const errorMessage = err instanceof Error ? err.message : 'Unknown error occurred'; return { content: [{ type: "text" as const, text: `Error getting custom perspective tasks: ${errorMessage}` }], isError: true }; } }

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

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