Skip to main content
Glama
bsmi021

MCP Task Manager Server

by bsmi021

createProject

Initiate a new project workspace in the MCP Task Manager Server database, assigning a unique UUID. Optionally specify a custom name or use a default timestamped name. Used by AI agents to start structured task management.

Instructions

Creates a new, empty project entry in the Task Management Server database. This tool is used by clients (e.g., AI agents) to initiate a new workspace for tasks. It returns the unique identifier (UUID) assigned to the newly created project. An optional name can be provided; otherwise, a default name including a timestamp will be generated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameNoOptional human-readable name for the new project (max 255 chars). If omitted, a default name like 'New Project [timestamp]' will be used.

Implementation Reference

  • The asynchronous handler function for the createProject tool. It processes the input args, calls ProjectService.createProject, formats the response with project_id, and handles errors.
    const processRequest = async (args: CreateProjectArgs) => {
        logger.info(`[${TOOL_NAME}] Received request with args:`, args);
        try {
            // Call the service method to create the project
            const newProject = await projectService.createProject(args.projectName);
    
            // Format the successful response according to MCP standards
            const responsePayload = { project_id: newProject.project_id };
            logger.info(`[${TOOL_NAME}] Project created successfully: ${newProject.project_id}`);
    
            return {
                content: [{
                    type: "text" as const, // Required type assertion
                    text: JSON.stringify(responsePayload)
                }]
            };
        } catch (error: unknown) {
            // Handle potential errors from the service layer
            logger.error(`[${TOOL_NAME}] Error processing request:`, error);
    
            // Basic error mapping: Assume internal error unless a specific known error type is caught
            // TODO: Add more specific error mapping if ProjectService throws custom errors
            // (e.g., catch (error instanceof ValidationError) { throw new McpError(ErrorCode.InvalidParams, ...)})
            const message = error instanceof Error ? error.message : 'An unknown error occurred during project creation.';
            throw new McpError(ErrorCode.InternalError, message);
        }
    };
  • Defines the input schema using Zod for the createProject tool parameters (projectName: optional string), TOOL_NAME, TOOL_DESCRIPTION, and the inferred CreateProjectArgs type.
    // Define the shape of the parameters for the server.tool method
    export const TOOL_PARAMS = {
        projectName: z.string()
            .max(255, "Project name cannot exceed 255 characters.") // Max length constraint
            .optional() // Optional parameter
            .describe("Optional human-readable name for the new project (max 255 chars). If omitted, a default name like 'New Project [timestamp]' will be used."), // Detailed description
    };
    
    // Create a Zod schema object from the shape for validation and type inference
    const toolParamsSchema = z.object(TOOL_PARAMS);
    
    // Define the expected type for arguments based on the Zod schema
    export type CreateProjectArgs = z.infer<typeof toolParamsSchema>;
  • The createProjectTool function that defines and registers the MCP tool with the server using server.tool(), including the handler, schema, and description.
    export const createProjectTool = (server: McpServer, projectService: ProjectService): void => {
    
        // Define the asynchronous function that handles the actual tool logic
        const processRequest = async (args: CreateProjectArgs) => {
            logger.info(`[${TOOL_NAME}] Received request with args:`, args);
            try {
                // Call the service method to create the project
                const newProject = await projectService.createProject(args.projectName);
    
                // Format the successful response according to MCP standards
                const responsePayload = { project_id: newProject.project_id };
                logger.info(`[${TOOL_NAME}] Project created successfully: ${newProject.project_id}`);
    
                return {
                    content: [{
                        type: "text" as const, // Required type assertion
                        text: JSON.stringify(responsePayload)
                    }]
                };
            } catch (error: unknown) {
                // Handle potential errors from the service layer
                logger.error(`[${TOOL_NAME}] Error processing request:`, error);
    
                // Basic error mapping: Assume internal error unless a specific known error type is caught
                // TODO: Add more specific error mapping if ProjectService throws custom errors
                // (e.g., catch (error instanceof ValidationError) { throw new McpError(ErrorCode.InvalidParams, ...)})
                const message = error instanceof Error ? error.message : 'An unknown error occurred during project creation.';
                throw new McpError(ErrorCode.InternalError, message);
            }
        };
    
        // Register the tool with the server
        server.tool(TOOL_NAME, TOOL_DESCRIPTION, TOOL_PARAMS, processRequest);
    
        logger.info(`[${TOOL_NAME}] Tool registered successfully.`);
    };
  • Calls the createProjectTool registration function during overall tools registration.
    createProjectTool(server, projectService);
  • The ProjectService.createProject method that performs the actual database insertion of a new project via the repository.
    public async createProject(projectName?: string): Promise<ProjectData> {
        const projectId = uuidv4();
        const now = new Date().toISOString();
        const finalProjectName = projectName?.trim() || `New Project ${now}`;
        const newProject: ProjectData = {
            project_id: projectId,
            name: finalProjectName,
            created_at: now,
        };
        logger.info(`[ProjectService] Attempting to create project: ${projectId} with name "${finalProjectName}"`);
        try {
            this.projectRepository.create(newProject);
            logger.info(`[ProjectService] Successfully created project: ${projectId}`);
            return newProject;
        } catch (error) {
            logger.error(`[ProjectService] Error creating project ${projectId}:`, error);
            throw error;
        }
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool creates a new entry (mutation behavior), returns a UUID, and handles default naming. However, it lacks details on permissions, error conditions, or side effects, which are important for a creation tool with no annotation coverage.

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 front-loaded with the core purpose, followed by usage context, return value, and parameter details in four concise sentences. Each sentence adds essential information without redundancy, making it efficient and well-structured.

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

Completeness4/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 (creation operation with one optional parameter) and no output schema, the description adequately covers the purpose, return value, and parameter behavior. However, it could improve by addressing potential errors or constraints, as annotations are absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the baseline is 3. The description adds value by explaining the optional nature of the parameter and the consequence of omission (default name generation), which enhances understanding beyond the schema's technical details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Creates a new, empty project entry'), resource ('in the Task Management Server database'), and distinguishes it from siblings like 'importProject' or 'exportProject' by specifying it creates an empty entry rather than importing data.

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 implies usage context ('used by clients to initiate a new workspace for tasks') but does not explicitly state when to use this tool versus alternatives like 'importProject' or provide exclusions. It mentions the optional name parameter but lacks guidance on prerequisites or scenarios.

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

Related 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/bsmi021/mcp-task-manager-server'

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