Skip to main content
Glama

getCurrentProject

Retrieves the current Teamwork project by checking the .teamwork file or prompting the user for the project ID.

Instructions

Get the current solution's Teamwork project, always check the .teamwork file in the root of the solution for the Teamwork project ID or ask the user which project they are working on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe current Teamwork project ID associated with the solution.

Implementation Reference

  • The tool handler that receives input, extracts projectId, calls the service, and returns the result as MCP content.
    export async function handleGetCurrentProject(input: any) {
    
      try {
        
        const projectId = String(input?.projectId);
        if (!projectId) {
          throw new Error("Project ID is required");
        }
        
        const result = await teamworkService.getCurrentProject(projectId);
           
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Retrieving current project');
      }
    } 
  • The tool definition/schema including name, description, inputSchema (requires projectId as integer), and annotations.
    export const getCurrentProjectDefinition = {
      name: "getCurrentProject",
      description: "Get the current solution's Teamwork project, always check the `.teamwork` file in the root of the solution for the Teamwork project ID or ask the user which project they are working on.",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "integer",
            description: "The current Teamwork project ID associated with the solution."
          }
        },
        required: ["projectId"]
      },
      annotations: {
        title: "Get the Current Project",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • The service-layer implementation that calls the Teamwork API at /projects/{projectId}.json to fetch the current project.
    import logger from '../../utils/logger.js';
    import { ensureApiClient } from '../core/apiClient.js';
    
    /**
     * Gets the current Teamwork project
     * @param projectId The Teamwork project ID that you should first find stored in the .teamwork file in the solution root
     * @returns An object with success status and project details or error message
     */
    export const getCurrentProject = async (projectId: string) => {
      try {
        if (!projectId) {
          return { 
            success: false, 
            error: `Current Teamwork project ID was not provided` 
          };
        }
        
        const api = ensureApiClient();
        const response = await api.get(`/projects/${projectId}.json`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error getting current project: ${error.message}`);
        throw new Error(`Failed to get current project`);  
      };
    };
    
    export default getCurrentProject; 
  • src/tools/index.ts:8-8 (registration)
    Import of the tool definition and handler from the getCurrentProject module.
    import { getCurrentProjectDefinition as getCurrentProject, handleGetCurrentProject } from './projects/getCurrentProject.js';
  • Registration of the getCurrentProject tool in the toolPairs array with its definition and handler.
    { definition: getCurrentProject, handler: handleGetCurrentProject },
Behavior4/5

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

The description adds behavioral context (checking a file, asking user) beyond annotations. No contradiction with annotations; readOnlyHint false is not clearly contradicted by 'get' since it may imply a mutation? Actually, 'get' suggests read-only, but annotation says false, so slight ambiguity. But description doesn't mention mutations, so no contradiction.

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 sentence but includes an imperative instruction. It is relatively concise and front-loaded with the purpose, though it could be more streamlined.

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?

Missing output schema and no description of what the tool returns. The tool likely returns a project object, but this is not specified. Given the complexity and sibling tools, more details would be beneficial.

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 already provides a clear description for projectId (100% coverage). The tool description adds little additional meaning, just that the parameter can be obtained from a file or user.

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 it gets the Teamwork project for the current solution, using a specific resource and verb. It mentions checking a file or asking the user, which adds specificity but could be clearer about how it differs from getProjectById.

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 advises checking a file or asking the user, implying when to use it. However, it does not explicitly state when not to use it or contrast with sibling tools like getProjects or getProjectById.

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/Vizioz/Teamwork-MCP'

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