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
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| fieldId | Yes | ||
| name | No | ||
| description | No | ||
| options | No | ||
| required | No |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"type": "string"
},
"fieldId": {
"type": "string"
},
"name": {
"type": "string"
},
"options": {
"items": {
"properties": {
"color": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
},
"projectId": {
"type": "string"
},
"required": {
"type": "boolean"
}
},
"required": [
"projectId",
"fieldId"
],
"type": "object"
}
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>;
- src/infrastructure/tools/ToolRegistry.ts:171-171 (registration)Registration of the updateProjectFieldTool in the central ToolRegistry during built-in tools initialization.this.registerTool(updateProjectFieldTool);
- src/infrastructure/tools/ToolSchemas.ts:866-887 (registration)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" } ] } } ] };
- src/index.ts:258-259 (handler)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);