Skip to main content
Glama

getCurrentProject

Retrieve the active Teamwork project ID for the current solution by checking the .teamwork file or prompting the user for clarification.

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 handler function that executes the tool logic. It extracts the projectId from input, calls the teamworkService to get the current project details, formats the result as JSON text content, or returns an error response.
    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 schema/definition specifying name, description, input schema requiring projectId (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
      }
    };
  • Registration of the getCurrentProject tool in the central toolPairs array, associating its definition and handler.
    { definition: getCurrentProject, handler: handleGetCurrentProject },
  • src/tools/index.ts:8-8 (registration)
    Import of the tool definition and handler from the specific projects file.
    import { getCurrentProjectDefinition as getCurrentProject, handleGetCurrentProject } from './projects/getCurrentProject.js';
  • Supporting service function called by the handler to fetch project details from the Teamwork API using the provided projectId.
    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`);  
      };
    };
Behavior3/5

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

Annotations indicate readOnlyHint=false, destructiveHint=false, and openWorldHint=false, covering safety and scope. The description adds behavioral context by explaining the source of the project ID (`.teamwork` file or user input), which isn't in the annotations. However, it doesn't disclose other traits like error handling, response format, or rate limits, leaving some gaps in behavioral understanding.

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 concise and well-structured in a single sentence, front-loading the purpose and following with usage instructions. Every part earns its place by providing essential information without redundancy. It could be slightly more streamlined by integrating the purpose and usage more seamlessly, but it's efficient overall.

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 (1 required parameter, no output schema), the description is somewhat complete but has gaps. It explains the purpose and usage well but lacks details on return values, error cases, or interactions with other tools. With annotations covering basic traits, it's adequate but not fully comprehensive for optimal agent use.

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 'projectId' parameter fully documented. The description adds no additional parameter semantics beyond what the schema provides, such as format details or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't need to.

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 the current solution's Teamwork project.' It specifies the verb 'Get' and resource 'Teamwork project,' and distinguishes it from siblings like 'getProjects' by focusing on the 'current' project. However, it doesn't explicitly contrast with all sibling tools, such as 'getProjectPerson,' which slightly limits differentiation.

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 clear usage context: '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.' This gives explicit guidance on when and how to use the tool, including prerequisites. It doesn't specify when NOT to use it or name alternatives like 'getProjects,' but the context is sufficiently detailed for effective use.

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