Summary
No tools exist to create or modify project fields or their options. Autonomous agents need this to set up project boards programmatically (e.g. adding a new Status column, creating a custom field).
Upstream gap identified in: github#2679
New Tools
create_project_field
Parameters:
owner_type (required): "user" or "org"
owner (required): login
project_number (required): int
name (required): field name
data_type (required): "TEXT" | "NUMBER" | "DATE" | "SINGLE_SELECT" | "ITERATION"
options (optional): array of option names for SINGLE_SELECT
add_project_field_option
Add a new option to an existing single-select field.
Parameters:
owner_type (required): "user" or "org"
owner (required): login
project_number (required): int
field_id (required): numeric field ID
option_name (required): name of the new option
color (optional): "BLUE" | "GREEN" | "RED" | "YELLOW" | "ORANGE" | "PINK" | "PURPLE" | "GRAY"
delete_project_field
Parameters:
owner_type, owner, project_number, field_id
Implementation
These require GraphQL mutations. Use the githubv4 / gqlClient pattern already present in the codebase.
GraphQL: add_project_field_option
mutation AddFieldOption($fieldId: ID!, $name: String!, $color: ProjectV2SingleSelectFieldOptionColor!) {
addProjectV2SingleSelectFieldOption(input: {
fieldId: $fieldId
name: $name
color: $color
}) {
projectV2SingleSelectField {
id
name
options { id name color }
}
}
}
GraphQL: create_project_field
mutation CreateField($projectId: ID!, $name: String!, $dataType: ProjectV2CustomFieldType!) {
createProjectV2Field(input: {
projectId: $projectId
name: $name
dataType: $dataType
}) {
projectV2Field {
... on ProjectV2Field { id name dataType }
... on ProjectV2SingleSelectField { id name options { id name } }
}
}
}
Finding project/field node IDs
Project node_id: GET /users/{owner}/projectsV2/{project_number} → node_id
Field node_id: use listProjectFieldsRaw (already in this fork) → match by numeric id, use node_id
GraphQL client pattern
Search for GetGQLClientFn or existing graphql usage in pkg/github/ to find the right pattern for mutations. If githubv4 typed client is awkward for mutations, use client.NewRequest POST to /graphql with a raw body.
Files to Modify
pkg/github/projects.go — implement three new tool functions
pkg/github/projects_test.go — unit tests with mocked responses
- toolset registration — add to
projects toolset
Summary
No tools exist to create or modify project fields or their options. Autonomous agents need this to set up project boards programmatically (e.g. adding a new Status column, creating a custom field).
Upstream gap identified in: github#2679
New Tools
create_project_fieldParameters:
owner_type(required):"user"or"org"owner(required): loginproject_number(required): intname(required): field namedata_type(required):"TEXT"|"NUMBER"|"DATE"|"SINGLE_SELECT"|"ITERATION"options(optional): array of option names forSINGLE_SELECTadd_project_field_optionAdd a new option to an existing single-select field.
Parameters:
owner_type(required):"user"or"org"owner(required): loginproject_number(required): intfield_id(required): numeric field IDoption_name(required): name of the new optioncolor(optional):"BLUE"|"GREEN"|"RED"|"YELLOW"|"ORANGE"|"PINK"|"PURPLE"|"GRAY"delete_project_fieldParameters:
owner_type,owner,project_number,field_idImplementation
These require GraphQL mutations. Use the
githubv4/gqlClientpattern already present in the codebase.GraphQL: add_project_field_option
GraphQL: create_project_field
Finding project/field node IDs
Project node_id:
GET /users/{owner}/projectsV2/{project_number}→node_idField node_id: use
listProjectFieldsRaw(already in this fork) → match by numericid, usenode_idGraphQL client pattern
Search for
GetGQLClientFnor existinggraphqlusage inpkg/github/to find the right pattern for mutations. Ifgithubv4typed client is awkward for mutations, useclient.NewRequestPOST to/graphqlwith a raw body.Files to Modify
pkg/github/projects.go— implement three new tool functionspkg/github/projects_test.go— unit tests with mocked responsesprojectstoolset