Skip to main content
Glama
dragosroua

addTaskManager MCP Server

by dragosroua

decide_assign_context

Assign contexts to tasks or projects within the Decide realm of the ADD framework, enabling structured organization and workflow management.

Instructions

Assign contexts to tasks/projects in Decide realm.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemRecordNameYesRecord name of the task or project
itemTypeYesType of item (Task or Project)
contextRecordNameYesRecord name of the context to assign

Implementation Reference

  • Core handler for 'decide_assign_context' tool. Validates item exists and is in Decide realm (ID=2), simulates CloudKit update to set context reference on Task/Project, returns confirmation message. Uses mockFetchItem helper.
    private async assignContextToItem(itemRecordName: string, itemType: 'Task' | 'Project', contextRecordName: string) {
      // Validate that item is in Decide realm before assigning context
      const item = await this.mockFetchItem(itemRecordName, itemType);
      if (!item) {
        throw new McpError(ErrorCode.InvalidParams, `${itemType} ${itemRecordName} not found`);
      }
      if (item.realmId !== REALM_DECIDE_ID) {
        throw new McpError(ErrorCode.InvalidParams, `${itemType} ${itemRecordName} must be in Decide realm to assign context. Current realm: ${item.realmId}`);
      }
      
      // Mock update: console.log('Mock CloudKit: Assigning context', contextRecordName, 'to', itemType, itemRecordName);
      return { content: [{ type: 'text', text: `Context ${contextRecordName} assigned to ${itemType} ${itemRecordName} in Decide realm.` }] };
  • src/index.ts:428-439 (registration)
    Tool registration in ListToolsRequestSchema response. Defines name, description, and input schema for decide_assign_context.
      name: 'decide_assign_context',
      description: 'Assign contexts to tasks/projects in Decide realm.',
      inputSchema: {
        type: 'object',
        properties: {
          itemRecordName: { type: 'string', description: 'Record name of the task or project' },
          itemType: { type: 'string', enum: ['Task', 'Project'], description: 'Type of item (Task or Project)' },
          contextRecordName: { type: 'string', description: 'Record name of the context to assign' }
        },
        required: ['itemRecordName', 'itemType', 'contextRecordName']
      }
    },
  • Dispatch handler in CallToolRequestSchema switch statement. Validates arguments and calls the main assignContextToItem handler.
    case 'decide_assign_context':
      this.validateArgs(args, ['itemRecordName', 'itemType', 'contextRecordName']);
      if (!['Task', 'Project'].includes(args.itemType)) {
          throw new McpError(ErrorCode.InvalidParams, "itemType must be 'Task' or 'Project'.");
      }
      return await this.assignContextToItem(args.itemRecordName, args.itemType as 'Task' | 'Project', args.contextRecordName);
  • Helper function used by assignContextToItem to mock-fetch item data from CloudKit for realm validation. Simulates different realm states based on recordName patterns.
    private async mockFetchItem(itemRecordName: string, itemType: 'Task' | 'Project'): Promise<any> {
      // Mock different scenarios based on record name patterns
      const baseItem = {
        recordName: itemRecordName,
        type: itemType,
        lastModified: new Date().toISOString()
      };
    
      // Simulate different states for validation testing
      if (itemRecordName.includes('assess')) {
        return { ...baseItem, realmId: REALM_ASSESS_ID, contextRecordName: null, endDate: null };
      } else if (itemRecordName.includes('undecided')) {
        return { ...baseItem, realmId: REALM_DECIDE_ID, contextRecordName: null, endDate: null };
      } else if (itemRecordName.includes('stalled')) {
        const yesterday = new Date(Date.now() - 86400000).toISOString();
        return { ...baseItem, realmId: REALM_DECIDE_ID, contextRecordName: 'context_work', endDate: yesterday };
      } else if (itemRecordName.includes('ready')) {
        const tomorrow = new Date(Date.now() + 86400000).toISOString();
        return { ...baseItem, realmId: REALM_DECIDE_ID, contextRecordName: 'context_work', endDate: tomorrow };
      } else if (itemRecordName.includes('do')) {
        const today = new Date().toISOString();
        return { ...baseItem, realmId: REALM_DO_ID, contextRecordName: 'context_work', endDate: today };
      } else {
        // Default to Assess realm item
        return { ...baseItem, realmId: REALM_ASSESS_ID, contextRecordName: null, endDate: null };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'assigns' contexts, implying a mutation operation, but doesn't describe what this entails—whether it overwrites existing contexts, requires specific permissions, or has side effects. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a simple tool, though it could be slightly more informative without losing conciseness.

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?

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is incomplete. It doesn't cover behavioral aspects like permissions or side effects, nor does it explain the outcome of the assignment. For a tool that modifies data in a system with many sibling tools, more context is needed to ensure proper usage.

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%, so the schema already documents all three parameters (itemRecordName, itemType, contextRecordName) with their types and constraints. The description adds no additional meaning beyond what the schema provides, such as explaining what 'Record name' refers to or how contexts relate to tasks/projects. Baseline 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.

Purpose4/5

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

The description clearly states the action ('Assign contexts') and target ('to tasks/projects in Decide realm'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_tasks_by_context' or 'assess_create_context', which handle related but different 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. It doesn't mention prerequisites (e.g., needing existing tasks/projects and contexts), nor does it contrast with sibling tools that might handle context-related operations differently, such as 'assess_create_context' for creating contexts or 'get_tasks_by_context' for retrieving tasks by context.

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