Skip to main content
Glama
niondigital

MoCo MCP Server

by niondigital

get_user_projects

Retrieve your assigned projects from MoCo time tracking system, with optional search by name or description to find specific work items.

Instructions

Get all projects assigned to the current user or search within assigned projects by name/description. If no query is provided, returns all assigned projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoOptional search query to find projects by name or description (case-insensitive)

Implementation Reference

  • The main handler for the get_user_projects tool. It uses MocoApiService to fetch user projects or search by query, formats results, and handles errors.
    export const getUserProjectsTool = {
      name: 'get_user_projects',
      description: 'Get all projects assigned to the current user or search within assigned projects by name/description. If no query is provided, returns all assigned projects.',
      inputSchema: zodToJsonSchema(GetProjectsSchema),
      handler: async (params: z.infer<typeof GetProjectsSchema>): Promise<string> => {
        const { query } = params;
    
        try {
          const apiService = new MocoApiService();
          
          // If query is provided and not empty, search; otherwise list all
          if (query && query.trim()) {
            const projects = await apiService.searchProjects(query.trim());
    
            if (projects.length === 0) {
              return createEmptyResultMessage({ 
                type: 'projects',
                query: query.trim()
              });
            }
    
            return formatProjectsSearchResults(projects, query.trim());
          } else {
            const projects = await apiService.getProjects();
    
            if (projects.length === 0) {
              return createEmptyResultMessage({ type: 'projects' });
            }
    
            return formatProjectsList(projects);
          }
    
        } catch (error) {
          return `Error retrieving projects: ${error instanceof Error ? error.message : 'Unknown error'}`;
        }
      }
    };
  • Zod schema defining the input for get_user_projects tool: optional query string.
    const GetProjectsSchema = z.object({
      query: z.string().optional().describe('Optional search query to find projects by name or description (case-insensitive)')
    });
  • src/index.ts:34-42 (registration)
    Registration of getUserProjectsTool in the AVAILABLE_TOOLS array used by the MCP server for tool listing and execution.
    const AVAILABLE_TOOLS = [
      getActivitiesTool,
      getUserProjectsTool,
      getUserProjectTasksTool,
      getUserHolidaysTool,
      getUserPresencesTool,
      getUserSickDaysTool,
      getPublicHolidaysTool
    ];
  • Helper function to format the list of user projects into a readable string format.
    function formatProjectsList(projects: Project[]): string {
      const lines: string[] = [];
      
      lines.push(`Assigned projects (${projects.length}):\n`);
    
      projects.forEach(project => {
        lines.push(`ID: ${project.id}`);
        lines.push(`Name: ${project.name}`);
        
        if (project.description) {
          lines.push(`Description: ${project.description}`);
        }
        
        lines.push(`Status: ${project.active ? 'Active' : 'Inactive'}`);
        
        if (project.customer) {
          lines.push(`Customer: ${project.customer.name}`);
        }
        
        if (project.leader) {
          lines.push(`Leader: ${project.leader.firstname} ${project.leader.lastname}`);
        }
        
        if (project.budget) {
          lines.push(`Budget: ${project.budget} ${project.currency}`);
        }
        
        lines.push(''); // Empty line between projects
      });
    
      return lines.join('\\n');
    }
  • Helper function to format search results for projects with search term highlighting.
    function formatProjectsSearchResults(projects: Project[], query: string): string {
      const lines: string[] = [];
      
      lines.push(`Search results for "${query}" (${projects.length} found):\n`);
    
      projects.forEach(project => {
        lines.push(`ID: ${project.id}`);
        lines.push(`Name: ${highlightSearchTerm(project.name, query)}`);
        
        if (project.description) {
          lines.push(`Description: ${highlightSearchTerm(project.description, query)}`);
        }
        
        lines.push(`Status: ${project.active ? 'Active' : 'Inactive'}`);
        
        if (project.customer) {
          lines.push(`Customer: ${project.customer.name}`);
        }
        
        lines.push(''); // Empty line between projects
      });
    
      return lines.join('\\n');
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the search functionality and case-insensitive behavior (implied from the schema), but lacks details on permissions, rate limits, pagination, or error handling. For a tool that likely interacts with user data, this is a significant gap in transparency, as it doesn't address potential constraints or side effects beyond basic operation.

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 highly concise and well-structured, consisting of just two sentences that efficiently convey the tool's functionality and conditional behavior. Every sentence earns its place by providing essential information without redundancy, making it easy to parse and understand quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (one optional parameter, no output schema, no annotations), the description is adequate but incomplete. It explains what the tool does and how the parameter affects output, but lacks details on return format, error cases, or integration with sibling tools. For a user-facing query tool, more context on results and limitations would enhance completeness, though it meets minimum viability.

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?

The input schema has 100% description coverage, with the 'query' parameter well-documented in the schema itself. The description adds minimal value beyond the schema by reiterating the optional nature of the query and its effect on output. Since the schema already covers the parameter semantics comprehensively, the baseline score of 3 is appropriate, as the description doesn't provide additional meaningful context.

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 tool's purpose: 'Get all projects assigned to the current user or search within assigned projects by name/description.' It specifies the verb ('Get'), resource ('projects'), and scope ('assigned to the current user'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'get_user_project_tasks', which focuses on tasks rather than projects.

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

Usage Guidelines3/5

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

The description provides some usage guidance by explaining the conditional behavior: 'If no query is provided, returns all assigned projects.' This implies that the tool can be used for both listing all projects and searching. However, it doesn't offer explicit when-to-use guidance compared to alternatives (e.g., when to use this vs. 'get_user_project_tasks' or other sibling tools), leaving the context somewhat implied rather than clearly defined.

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