Skip to main content
Glama

update_project_field

Modify custom field properties in GitHub projects, including name, description, options, and required status, to adapt project tracking to changing needs.

Instructions

Update a custom field in a GitHub project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
fieldIdYes
nameNo
descriptionNo
optionsNo
requiredNo

Implementation Reference

  • Core handler method that processes the update_project_field tool call. Validates input, prepares update data, and delegates to GitHubProjectRepository.updateField for execution.
    async updateProjectField(data: {
      projectId: string;
      fieldId: string;
      name?: string;
      options?: Array<{
        name: string;
        color?: string;
      }>;
    }): Promise<CustomField> {
      try {
        const updateData: Partial<CustomField> = {};
    
        if (data.name !== undefined) {
          updateData.name = data.name;
        }
    
        if (data.options !== undefined) {
          updateData.options = data.options.map(option => ({
            id: '', // This will be assigned by GitHub
            name: option.name,
            color: option.color
          }));
        }
    
        return await this.projectRepo.updateField(data.projectId, data.fieldId, updateData);
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema definition for validating input arguments to the update_project_field tool.
    // Schema for update_project_field tool
    export const updateProjectFieldSchema = z.object({
      projectId: z.string().min(1, "Project ID is required"),
      fieldId: z.string().min(1, "Field ID is required"),
      name: z.string().optional(),
      description: z.string().optional(),
      options: z.array(
        z.object({
          id: z.string().optional(),
          name: z.string().min(1),
          description: z.string().optional(),
          color: z.string().optional(),
        })
      ).optional(),
      required: z.boolean().optional(),
    });
    
    export type UpdateProjectFieldArgs = z.infer<typeof updateProjectFieldSchema>;
  • Registration of the updateProjectFieldTool in the central ToolRegistry during built-in tools initialization.
    this.registerTool(updateProjectFieldTool);
  • ToolDefinition export that defines the tool metadata (name, description, schema, examples) used for registration and MCP tool listing.
    export const updateProjectFieldTool: ToolDefinition<UpdateProjectFieldArgs> = {
      name: "update_project_field",
      description: "Update a custom field in a GitHub project",
      schema: updateProjectFieldSchema as unknown as ToolSchema<UpdateProjectFieldArgs>,
      examples: [
        {
          name: "Update field options",
          description: "Update options for a single-select field",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH",
            fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI1",
            name: "Updated Status",
            options: [
              { name: "Not Started", color: "red" },
              { name: "In Progress", color: "yellow" },
              { name: "Review", color: "blue" },
              { name: "Complete", color: "green" }
            ]
          }
        }
      ]
    };
  • MCP server request handler switch case that routes 'call_tool' requests for 'update_project_field' to the ProjectManagementService implementation.
    case "update_project_field":
      return await this.service.updateProjectField(args);

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/HarshKumarSharma/MCP'

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