Skip to main content
Glama

createProject

Set up new projects in Teamwork by defining project name, description, company ID, category ID, start date, end date, and status using Teamwork MCP's streamlined interface.

Instructions

Create a new project in Teamwork

Input Schema

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

Implementation Reference

  • Registration of the createProject tool (along with related project tools) in the toolPairs array, pairing the tool definition with its handler function.
    { definition: getProjects, handler: handleGetProjects }, { definition: getCurrentProject, handler: handleGetCurrentProject }, { definition: createProject, handler: handleCreateProject },
  • TypeScript interface defining the input parameters for creating a project.
    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 }
  • The main function implementing the project creation logic, which calls the Teamwork API. This is likely invoked by the tool handler `handleCreateProject`.
    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}`); } };
  • Creation of the tool handlers map, which maps the tool name 'createProject' to its handler function.
    export const toolHandlersMap: Record<string, Function> = toolPairs.reduce((map, pair) => { map[pair.definition.name] = pair.handler; return map; }, {} as Record<string, Function>);
  • Tool grouping configuration that includes 'createProject' for filtering purposes.
    'Projects': ['getProjects', 'getCurrentProject', 'createProject'],

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