MCP: name-based resolution for Projects fields#2760
Open
veralizeth wants to merge 8 commits into
Open
Conversation
…eld values by name through the GitHub MCP server
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Projects v2 MCP surface so agents can read and update project item field values using human-readable field/option names, with server-side resolution to the ID-typed REST/GraphQL operations that ultimately perform the write.
Changes:
- Add
field_namessupport toget_project_item/list_project_items, resolving names to field IDs server-side. - Extend
update_project_itemto acceptupdated_fieldby{name, value}(including single-select option-name resolution) and to resolveitem_idfrom(item_owner, item_repo, issue_number)when omitted. - Introduce structured, machine-readable resolution errors (
field_not_found,field_ambiguous,option_not_found,item_not_in_project, etc.) and update docs/toolsnaps accordingly.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new field_names inputs and expanded update_project_item parameter behavior. |
| pkg/github/projects.go | Wires field_names into list/get flows and adds name-based item/field resolution for updates. |
| pkg/github/projects_resolver.go | New GraphQL-based resolvers for project field and item ID resolution by name/issue number. |
| pkg/github/projects_resolver_test.go | Adds unit/acceptance tests for name resolution and structured error behavior. |
| pkg/github/toolsnaps/projects_write.snap | Updates snapshot to reflect update_project_item schema/description changes. |
| pkg/github/toolsnaps/projects_list.snap | Updates snapshot to reflect field_names addition and updated fields description. |
| pkg/github/toolsnaps/projects_get.snap | Updates snapshot to reflect field_names addition and updated fields description. |
| pkg/errors/error.go | Adds StructuredResolutionError type + helpers for JSON error payloads. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 4
- Review effort level: Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Let agents address Project v2 fields, options, and item values by name (read +write) instead of pre-resolved IDs. Resolution happens in the wrapper; the mutation stays ID-typed.
Why
Today an agent that wants to update a project field has to assemble several opaque IDs (project, item, field, single-select option) before it can write. The MCP
update_project_itemtool is only partly there, it accepts owner login, project number, and issue number, but the write still demands the field ID and item ID and does no option-name resolution.update_project_itemdemands field ID + item ID and does no option-name resolution. Reads are ID-bound too:list_project_itemsreturns only Title, so reading a field value needs alist_project_fields. This forces a list-and-filter dance, burns context, and invites mis-bound IDs.The important part: this is a surfacing gap, not a platform gap. The GraphQL API already resolves names
projectV2.field(name:),ProjectV2SingleSelectField.options(names:),ProjectV2Item.fieldValueByName(name:), plus top-level lookups by login / owner+name / project number. A single nested read can fetch every ID the write needs. The agent surface simply doesn't pass those resolvers through.Closes #3430
What changed
update_project_itemaccepts a field viaupdated_field.name, resolves the single-select option by name, and resolves the item byitem_owner+item_repo+issue_numberwhenitem_idis omitted.{id}/{name}mutually exclusive.field_namesonget_project_item/list_project_itemsnolist_project_fieldspreflight.field_not_found,field_ambiguous,option_not_found,item_not_in_project, …) with candidates. Backward compatible, existing ID paths unchanged; new inputs additive/optional.Follow-up
projectItems(first: 50), bound and paginate Project item read payloads so an agent can pull field values for a large board without overflowing its buffer or burning context. #3332.MCP impact
Prompts tested (tool changes only)
Security / limits
Schema token delta, measured with
o200k_base:projects_getprojects_listprojects_writeHow this was measured
Used
mcpcurl schemato dump thetools/listpayload (name+description+inputSchema) onmainvs. this branch, tokenized both withtiktoken(o200k_baseencoding), and diffed.Prompts tested
field_namesno field-ID preflight.field_ambiguouswith candidates.field_names: ["Statuss"]→field_not_foundwith candidates.Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs