Skip to main content
Glama

createProject

Creates a new project in Teamwork. Specify the project name and optional details like description, dates, and status.

Instructions

Create a new project in Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the project (required)
descriptionNoThe description of the project
companyIdNoThe ID of the company the project belongs to
categoryIdNoThe ID of the category the project belongs to
startDateNoThe start date of the project (format: YYYYMMDD)
endDateNoThe end date of the project (format: YYYYMMDD)
statusNoThe status of the project

Implementation Reference

  • Tool handler that extracts input fields, constructs CreateProjectData, and delegates to the teamwork service to create the project.
    export async function handleCreateProject(input: any) {
      logger.info('Calling teamworkService.createProject()');
      logger.info(`Project name: ${input?.name}`);
    
      try {
        if (!input?.name) {
          throw new Error("Project name is required");
        }
        
        // Prepare project data
        const projectData: CreateProjectData = {
          name: input.name
        };
          
        // Add optional fields if provided
        if (input.description) projectData.description = input.description;
        if (input.companyId) projectData.companyId = input.companyId;
        if (input.categoryId) projectData.categoryId = input.categoryId;
        if (input.startDate) projectData.startDate = input.startDate;
        if (input.endDate) projectData.endDate = input.endDate;
        if (input.status) projectData.status = input.status;
        
        // Add any other properties that might be in the input
        Object.keys(input).forEach(key => {
          if (!['name', 'description', 'companyId', 'categoryId', 'startDate', 'endDate', 'status'].includes(key)) {
            projectData[key] = input[key];
          }
        });
        
        // Call the service to create the project
        const result = await teamworkService.createProject(projectData);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Creating project');
      }
    } 
  • MCP tool definition with input schema requiring only 'name', with optional fields for description, companyId, categoryId, startDate, endDate, and status.
    export const createProjectDefinition = {
      name: "createProject",
      description: "Create a new project in Teamwork",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "The name of the project (required)"
          },
          description: {
            type: "string",
            description: "The description of the project"
          },
          companyId: {
            type: "integer",
            description: "The ID of the company the project belongs to"
          },
          categoryId: {
            type: "integer",
            description: "The ID of the category the project belongs to"
          },
          startDate: {
            type: "string",
            description: "The start date of the project (format: YYYYMMDD)"
          },
          endDate: {
            type: "string",
            description: "The end date of the project (format: YYYYMMDD)"
          },
          status: {
            type: "string",
            description: "The status of the project"
          }
        },
        required: ["name"]
      },
      annotations: {
        title: "Create a Project",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • TypeScript interface defining the project creation data shape, with name required and optional fields.
    export interface CreateProjectData {
      name: string;
      description?: string;
      companyId?: number;
      categoryId?: number;
      startDate?: string; // Format: YYYYMMDD
      endDate?: string;   // Format: YYYYMMDD
      status?: string;
      [key: string]: any; // Allow additional properties
    }
  • Service-layer function that makes the actual POST request to the Teamwork API v1 /projects.json endpoint, wrapping data in a 'project' object.
    export const createProject = async (projectData: CreateProjectData) => {
      try {
        logger.info('Creating new project in Teamwork');
        
        if (!projectData.name) {
          throw new Error('Project name is required');
        }
        
        // The v1 API endpoint for creating projects is /projects.json
        const api = getApiClientForVersion('v1');
        
        // The API expects the project data to be wrapped in a 'project' object
        const requestData = {
          project: projectData
        };
        
        logger.info(`Creating project with name: ${projectData.name}`);
        
        const response = await api.post('/projects.json', requestData);
        
        logger.info(`Successfully created project: ${projectData.name}`);
        logger.info(`Project ID: ${response.data?.id || 'Unknown'}`);
        
        return response.data;
      } catch (error: any) {
        logger.error(`Failed to create project: ${error.message}`);
        throw new Error(`Failed to create project: ${error.message}`);
      }
    };
  • Registration of createProject into the toolHandlersMap by name, enabling dispatch from createProject to handleCreateProject.
    export const toolHandlersMap: Record<string, Function> = toolPairs.reduce((map, pair) => {
      map[pair.definition.name] = pair.handler;
      return map;
    }, {} as Record<string, Function>);
Behavior3/5

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

Annotations already indicate readOnlyHint=false and destructiveHint=false, so the agent knows it's a write operation. The description adds no extra behavioral context beyond what annotations provide.

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?

Single sentence, no wasted words, straight to the point. Front-loaded with the key action and resource.

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?

Description is minimal with no output schema. While schema covers parameters, the description does not explain return values or behavior like permission requirements. Adequate but not comprehensive.

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 has 100% description coverage for all 7 parameters. Tool description adds no additional meaning beyond the schema descriptions, so score is at baseline.

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?

Description clearly states verb 'create', resource 'project', and system 'Teamwork'. It distinguishes from siblings by name and title, but does not explicitly differentiate from other creation tools like createTask or createCompany.

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?

No guidance on when to use this tool versus alternatives such as addPeopleToProject or createTask. No prerequisites or context provided for usage.

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