Skip to main content
Glama
niondigital

MoCo MCP Server

by niondigital

get_user_project_tasks

Retrieve all tasks for a specific project assigned to you using the project ID. This tool helps you view and manage your project workload within the MoCo time tracking system.

Instructions

Get all tasks for a specific assigned project by project ID. Only works for projects assigned to the current user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID to retrieve tasks for

Implementation Reference

  • The main handler function for the get_user_project_tasks tool. Validates projectId, fetches tasks using MocoApiService, handles empty results and errors, and formats output using formatProjectTasks.
    handler: async (params: z.infer<typeof GetProjectTasksSchema>): Promise<string> => {
      const { projectId } = params;
    
      if (!Number.isInteger(projectId) || projectId <= 0) {
        return createValidationErrorMessage({
          field: 'projectId',
          value: projectId,
          reason: 'invalid_project_id'
        });
      }
    
      try {
        const apiService = new MocoApiService();
        const tasks = await apiService.getProjectTasks(projectId);
    
        if (tasks.length === 0) {
          return createEmptyResultMessage({ 
            type: 'tasks',
            projectId 
          });
        }
    
        return formatProjectTasks(tasks, projectId);
    
      } catch (error) {
        return `Error retrieving tasks for project ${projectId}: ${error instanceof Error ? error.message : 'Unknown error'}`;
      }
    }
  • Zod schema defining the input for the tool: requires a positive projectId number.
    const GetProjectTasksSchema = z.object({
      projectId: z.number().positive().describe('Project ID to retrieve tasks for')
    });
  • src/index.ts:34-42 (registration)
    The tool is imported and registered in the AVAILABLE_TOOLS array, which is used by the MCP server for tool listing and execution dispatching.
    const AVAILABLE_TOOLS = [
      getActivitiesTool,
      getUserProjectsTool,
      getUserProjectTasksTool,
      getUserHolidaysTool,
      getUserPresencesTool,
      getUserSickDaysTool,
      getPublicHolidaysTool
    ];
  • Helper function to format the list of tasks into a readable string output, used by the tool handler.
    function formatProjectTasks(tasks: Task[], projectId: number): string {
      const lines: string[] = [];
      
      lines.push(`Tasks for project ${projectId} (${tasks.length} found):\n`);
    
      tasks.forEach(task => {
        lines.push(`ID: ${task.id}`);
        lines.push(`Name: ${task.name}`);
        lines.push(`Status: ${task.active ? 'Active' : 'Inactive'}`);
        lines.push(`Billable: ${task.billable ? 'Yes' : 'No'}`);
        lines.push(''); // Empty line between tasks
      });
    
      return lines.join('\\n');
    }
Behavior3/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 adds context about the restriction to 'projects assigned to the current user,' which is useful beyond the input schema. However, it lacks details on other behavioral traits such as response format, pagination, error handling, or rate limits, leaving gaps for a mutation-free but context-sensitive tool.

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 front-loaded with the core purpose in the first sentence and adds a crucial restriction in the second. Both sentences earn their place by providing essential information without redundancy or fluff, making it highly efficient and well-structured.

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?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is mostly complete. It covers the purpose and key usage restriction. However, it lacks output details (e.g., what 'tasks' include, format) and could mention error cases (e.g., invalid project ID), leaving minor gaps for full contextual understanding.

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 parameter 'projectId' fully documented in the schema. The description does not add any additional meaning or syntax details beyond what the schema provides (e.g., it doesn't explain what constitutes a valid project ID beyond the schema's 'exclusiveMinimum: 0'). Baseline 3 is appropriate as the schema handles the parameter documentation.

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 all tasks') and resource ('for a specific assigned project by project ID'), distinguishing it from sibling tools like 'get_user_projects' (which retrieves projects, not tasks) and 'get_activities' (which retrieves activities, not tasks). It precisely defines the tool's function without redundancy.

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

Usage Guidelines4/5

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

The description provides explicit context for when to use this tool: 'Only works for projects assigned to the current user.' This clarifies the prerequisite condition. However, it does not explicitly state when not to use it or name alternatives (e.g., if tasks for unassigned projects are needed), which prevents a perfect score.

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/niondigital/moco-mcp'

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