Skip to main content
Glama
dragosroua

addTaskManager MCP Server

by dragosroua

get_tasks_by_context

Retrieve tasks filtered by specific context to organize and prioritize items within the ADD framework workflow.

Instructions

Filter by context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextRecordNameYesRecord name of the context to filter by

Implementation Reference

  • The core handler function implementing the tool logic: queries CloudKit Task records where contextRecordName equals the input parameter, sorts by endDate ascending, returns ZenTaskticTask[]
    async getTasksByContext(contextRecordName: string): Promise<ZenTaskticTask[]> {
      return this.queryRecords<ZenTaskticTask>('Task', {
        filterBy: [{ 
          fieldName: 'contextRecordName', 
          fieldValue: contextRecordName,
          comparator: 'EQUALS' 
        }],
        sortBy: [{ fieldName: 'endDate', ascending: true }]
      });
    }
  • MCP server wrapper handler for get_tasks_by_context tool: calls CloudKitService.getTasksByContext in production mode, formats results into MCP response, falls back to mock in dev
    private async getTasksByContext(contextRecordName: string) {
      return this.withCloudKitOrMock(
        'getTasksByContext',
        async () => {
          // CloudKit production implementation
          const tasks = await this.cloudKitService.getTasksByContext(contextRecordName);
          
          let response = `Tasks for context ${contextRecordName}:\n`;
          if (tasks.length === 0) {
            response += 'No tasks found for this context. 📋';
          } else {
            response += tasks.map((task: any) => {
              const name = task.fields?.taskName?.value || 'Unnamed Task';
              const realmId = task.fields?.realmId?.value || 1;
              const realmName = realmId === 1 ? 'Assess' : realmId === 2 ? 'Decide' : realmId === 3 ? 'Do' : 'Unknown';
              const priority = task.fields?.taskPriority?.value || 3;
              const priorityIcon = priority === 1 ? '🔴' : priority === 2 ? '🟡' : '🟢';
              
              return `- ${name} (${task.recordName}) [${realmName}] ${priorityIcon}`;
            }).join('\n');
          }
          
          return { content: [{ type: 'text', text: response }] };
        },
        async () => {
          // Mock implementation
          const mockTasks = [{ recordName: 'task_abc', taskName: 'Task with specific context' }];
          return { content: [{ type: 'text', text: `Found ${mockTasks.length} tasks for context ${contextRecordName}:\n${mockTasks.map(t => `- ${t.taskName} (${t.recordName})`).join('\n')}` }] };
        }
      );
    }
  • Input schema definition for the get_tasks_by_context tool in ListTools response
    {
      name: 'get_tasks_by_context',
      description: 'Filter by context.',
      inputSchema: {
        type: 'object',
        properties: {
          contextRecordName: { type: 'string', description: 'Record name of the context to filter by' }
        },
        required: ['contextRecordName']
      }
    },
  • src/index.ts:760-762 (registration)
    Tool registration/dispatch in CallToolRequestSchema switch statement: validates args and delegates to getTasksByContext method
      this.validateArgs(args, ['contextRecordName']);
      return await this.getTasksByContext(args.contextRecordName);
    case 'get_stalled_items_in_decide':
  • Type/schema definition for ZenTaskticTask returned by the handler (also likely in src/types/cloudkit.ts)
    export interface ZenTaskticTask {
      recordName?: string; // CloudKit record name (UUID string, typically)
      recordType: 'Task';
      fields: {
        taskName: { value: string }; // Max 1000 chars, combines original title & body
        realmId: { value: number }; // 1 (Assess), 2 (Decide), 3 (Do)
        uniqueId: { value: string }; // UUID string, primary key in CoreData model
        
        // Core Data model fields
        taskId?: { value: number }; // Integer 16, default 0
        contextId?: { value: number }; // Integer 16, default 0 (legacy field)
        taskAudioRecordId?: { value: number }; // Integer 16, default 0
        taskPictureId?: { value: number }; // Integer 16, default 0
        orderInParent?: { value: number }; // Integer 16, default 0
        taskPriority?: { value: number }; // Integer 16, 1-5, default 3
        
        // References (relationships in Core Data)
        context?: { value: CKReference }; // Reference to a Contexts record
        projects?: { value: CKReference }; // Reference to a Projects record (renamed from project)
        collection?: { value: CKReference }; // Reference to a Collections record
        ideas?: { value: CKReference }; // Reference to an Ideas record (if task derived from idea)
        realms?: { value: CKReference }; // Reference to Realms record
        
        // Dates
        startDate?: { value: number }; // Timestamp (milliseconds since epoch)
        endDate?: { value: number }; // Timestamp (due date, or completion date)
        lastModified: { value: number }; // Timestamp
        
        // Task-specific fields
        localNotification?: { value: string }; // Alert date/trigger (max 100 chars)
        taskParentId?: { value: string }; // UUID string of parent Task/Project/Idea
        taskParentType?: { value: string }; // 'Task', 'Project', 'Idea'
        
        // removed isCompleted, completion handled by setting endDate & potentially realm
      };
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description offers zero behavioral information. It doesn't indicate whether this is a read-only operation, what permissions might be required, whether it returns all tasks or paginated results, what format the output takes, or any error conditions. For a tool with no annotation coverage, this represents a complete failure to disclose behavioral traits.

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 maximally concise at just three words. While this conciseness comes at the expense of completeness, the description itself contains no wasted words and is perfectly front-loaded with its core function.

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

Completeness1/5

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

For a tool with no annotations, no output schema, and multiple similar sibling tools, the description is completely inadequate. It doesn't explain what 'context' means in this system, what format the filtered tasks are returned in, whether this is a read-only operation, or how it differs from other task retrieval tools. The agent would struggle to use this tool correctly.

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?

Schema description coverage is 100%, with the single parameter 'contextRecordName' well-documented in the schema as 'Record name of the context to filter by'. The description adds no additional parameter information beyond what's already in the schema, so the baseline score of 3 is appropriate when the schema does the heavy lifting.

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

Purpose2/5

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

The description 'Filter by context' is tautological - it essentially restates the tool name 'get_tasks_by_context' without specifying what resource is being filtered. While 'tasks' is implied from the name, the description doesn't explicitly state that this tool retrieves tasks filtered by context, nor does it differentiate from sibling tools like 'get_tasks_by_realm' or 'get_tasks_today_in_do'.

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

Usage Guidelines1/5

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

No guidance is provided about when to use this tool versus alternatives. With multiple task-retrieval siblings (get_tasks_by_realm, get_tasks_today_in_do, get_tasks_tomorrow_in_do, get_tasks_overdue_in_do, get_tasks_soon_in_do), the description offers no indication of what distinguishes this context-based filtering from other filtering approaches.

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/dragosroua/addtaskmanager-mcp-server'

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