Skip to main content
Glama

update_project

Modify project details such as name and description to reflect evolving requirements. Ensure project documentation remains accurate and up-to-date by specifying the working directory and unique project ID.

Instructions

Evolve and refine your project information as requirements change and scope develops. Maintain accurate project documentation with flexible updates to names and descriptions, ensuring your project data stays current and meaningful throughout the development lifecycle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoNew description for the project (optional)
idYesThe unique identifier of the project to update
nameNoNew name for the project (optional)
workingDirectoryYesThe full absolute path to the working directory where data is stored. MUST be an absolute path, never relative. Windows: "C:\Users\username\project" or "D:\projects\my-app". Unix/Linux/macOS: "/home/username/project" or "/Users/username/project". Do NOT use: ".", "..", "~", "./folder", "../folder" or any relative paths. Ensure the path exists and is accessible before calling this tool. NOTE: When server is started with --claude flag, this parameter is ignored and a global user directory is used instead.

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'update_project' tool. It performs input validation, checks project existence and name uniqueness, calls storage.updateProject, and returns formatted success or error responses.
        handler: async ({ id, name, description }: { id: string; name?: string; description?: string }) => {
          try {
            // Validate inputs
            if (!id || id.trim().length === 0) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project ID is required.'
                }],
                isError: true
              };
            }
    
            if (name !== undefined && (!name || name.trim().length === 0)) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project name must not be empty.'
                }],
                isError: true
              };
            }
    
            if (name !== undefined && name.trim().length > 100) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project name must be 100 characters or less.'
                }],
                isError: true
              };
            }
    
            if (description !== undefined && (!description || description.trim().length === 0)) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project description must not be empty.'
                }],
                isError: true
              };
            }
    
            if (description !== undefined && description.trim().length > 1000) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project description must be 1000 characters or less.'
                }],
                isError: true
              };
            }
    
            if (name === undefined && description === undefined) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: At least one field (name or description) must be provided for update.'
                }],
                isError: true
              };
            }
    
            const existingProject = await storage.getProject(id.trim());
    
            if (!existingProject) {
              return {
                content: [{
                  type: 'text' as const,
                  text: `Error: Project with ID "${id}" not found. Use list_projects to see all available projects.`
                }],
                isError: true
              };
            }
    
            // Check for name uniqueness if name is being updated
            if (name && name.toLowerCase() !== existingProject.name.toLowerCase()) {
              const existingProjects = await storage.getProjects();
              const nameExists = existingProjects.some(p => p.id !== id && p.name.toLowerCase() === name.toLowerCase());
    
              if (nameExists) {
                return {
                  content: [{
                    type: 'text' as const,
                    text: `Error: A project with the name "${name}" already exists. Please choose a different name.`
                  }],
                  isError: true
                };
              }
            }
    
            const updates: any = {
              updatedAt: new Date().toISOString()
            };
    
            if (name !== undefined) {
              updates.name = name.trim();
            }
    
            if (description !== undefined) {
              updates.description = description.trim();
            }
    
            const updatedProject = await storage.updateProject(id, updates);
    
            if (!updatedProject) {
              return {
                content: [{
                  type: 'text' as const,
                  text: `Error: Failed to update project with ID "${id}".`
                }],
                isError: true
              };
            }
    
            const changedFields = [];
            if (name !== undefined) changedFields.push('name');
            if (description !== undefined) changedFields.push('description');
    
            return {
              content: [{
                type: 'text' as const,
                text: `✅ Project updated successfully!
    
    **${updatedProject.name}** (ID: ${updatedProject.id})
    Description: ${updatedProject.description}
    Last Updated: ${new Date(updatedProject.updatedAt).toLocaleString()}
    
    Updated fields: ${changedFields.join(', ')}`
              }]
            };
          } catch (error) {
            return {
              content: [{
                type: 'text' as const,
                text: `Error updating project: ${error instanceof Error ? error.message : 'Unknown error'}`
              }],
              isError: true
            };
          }
        }
  • Zod inputSchema definition for the update_project tool, validating id (required string), name (optional string), and description (optional string).
    inputSchema: {
      id: z.string(),
      name: z.string().optional(),
      description: z.string().optional()
    },
  • createUpdateProjectTool function that constructs and exports the complete tool definition (name, description, schema, handler) for registration in the MCP server.
    export function createUpdateProjectTool(storage: Storage) {
      return {
        name: 'update_project',
        description: 'Update the name and/or description of an existing project',
        inputSchema: {
          id: z.string(),
          name: z.string().optional(),
          description: z.string().optional()
        },
        handler: async ({ id, name, description }: { id: string; name?: string; description?: string }) => {
          try {
            // Validate inputs
            if (!id || id.trim().length === 0) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project ID is required.'
                }],
                isError: true
              };
            }
    
            if (name !== undefined && (!name || name.trim().length === 0)) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project name must not be empty.'
                }],
                isError: true
              };
            }
    
            if (name !== undefined && name.trim().length > 100) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project name must be 100 characters or less.'
                }],
                isError: true
              };
            }
    
            if (description !== undefined && (!description || description.trim().length === 0)) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project description must not be empty.'
                }],
                isError: true
              };
            }
    
            if (description !== undefined && description.trim().length > 1000) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: Project description must be 1000 characters or less.'
                }],
                isError: true
              };
            }
    
            if (name === undefined && description === undefined) {
              return {
                content: [{
                  type: 'text' as const,
                  text: 'Error: At least one field (name or description) must be provided for update.'
                }],
                isError: true
              };
            }
    
            const existingProject = await storage.getProject(id.trim());
    
            if (!existingProject) {
              return {
                content: [{
                  type: 'text' as const,
                  text: `Error: Project with ID "${id}" not found. Use list_projects to see all available projects.`
                }],
                isError: true
              };
            }
    
            // Check for name uniqueness if name is being updated
            if (name && name.toLowerCase() !== existingProject.name.toLowerCase()) {
              const existingProjects = await storage.getProjects();
              const nameExists = existingProjects.some(p => p.id !== id && p.name.toLowerCase() === name.toLowerCase());
    
              if (nameExists) {
                return {
                  content: [{
                    type: 'text' as const,
                    text: `Error: A project with the name "${name}" already exists. Please choose a different name.`
                  }],
                  isError: true
                };
              }
            }
    
            const updates: any = {
              updatedAt: new Date().toISOString()
            };
    
            if (name !== undefined) {
              updates.name = name.trim();
            }
    
            if (description !== undefined) {
              updates.description = description.trim();
            }
    
            const updatedProject = await storage.updateProject(id, updates);
    
            if (!updatedProject) {
              return {
                content: [{
                  type: 'text' as const,
                  text: `Error: Failed to update project with ID "${id}".`
                }],
                isError: true
              };
            }
    
            const changedFields = [];
            if (name !== undefined) changedFields.push('name');
            if (description !== undefined) changedFields.push('description');
    
            return {
              content: [{
                type: 'text' as const,
                text: `✅ Project updated successfully!
    
    **${updatedProject.name}** (ID: ${updatedProject.id})
    Description: ${updatedProject.description}
    Last Updated: ${new Date(updatedProject.updatedAt).toLocaleString()}
    
    Updated fields: ${changedFields.join(', ')}`
              }]
            };
          } catch (error) {
            return {
              content: [{
                type: 'text' as const,
                text: `Error updating project: ${error instanceof Error ? error.message : 'Unknown error'}`
              }],
              isError: true
            };
          }
        }
      };
    }
  • TypeScript interface defining UpdateProjectInput with optional name and description fields, used in storage layer.
    export interface UpdateProjectInput {
      /** Project name (optional) */
      name?: string;
      /** Project description/overview (optional) */
      description?: string;
    }
  • File-based storage implementation of updateProject method, which updates the project record in memory and persists to JSON file.
    async updateProject(id: string, updates: Partial<Project>): Promise<Project | null> {
      const index = this.data.projects.findIndex(p => p.id === id);
      if (index === -1) return null;
    
      this.data.projects[index] = { ...this.data.projects[index], ...updates };
      await this.save();
      return this.data.projects[index];
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions 'flexible updates' and 'ensuring project data stays current,' it doesn't disclose critical behavioral traits: whether this is a mutation operation (implied but not stated), what permissions are required, whether changes are reversible, what happens to unspecified fields, or error conditions. For a mutation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences but contains some fluff language like 'as requirements change and scope develops' and 'throughout the development lifecycle' that doesn't add operational value. While not excessively verbose, it could be more direct and front-loaded with essential information. Some phrases feel marketing-oriented rather than functional.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens when the tool is invoked (success/failure responses), doesn't mention the required parameters (id and workingDirectory), and provides minimal behavioral context. Given the complexity of a project update operation, more completeness is needed.

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 schema description coverage is 100%, so the schema already fully documents all parameters. The description mentions 'names and descriptions' which aligns with the name and description parameters, but adds no additional semantic context beyond what's in the schema. It doesn't explain the relationship between parameters or provide usage examples. With high schema coverage, the baseline is 3.

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: 'Evolve and refine your project information' and 'Maintain accurate project documentation with flexible updates to names and descriptions.' It specifies the verb (update/evolve/refine) and resource (project information/documentation). However, it doesn't explicitly differentiate from sibling update tools like update_memory, update_subtask, or update_task, which is why it doesn't reach a 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'as requirements change and scope develops' but doesn't specify when to use update_project versus create_project, delete_project, or other update tools. There's no mention of prerequisites, constraints, or alternative tools for different 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/Pimzino/agentic-tools-mcp'

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