fix: correct todo tool GraphQL shapes (1.18.0)#38
Merged
Conversation
Three bugs shipped in 1.16.0 that none of us caught because the GraphQL
strings were never executed against a real GitLab:
1. mark_all_todos_done selected a non-existent updatedIds field on
TodosMarkAllDonePayload — every call failed with a GraphQL error.
Payload actually has todos { id state }; fix selects that.
2. list_my_todos groupPath/projectPath filters were silently dropped.
The shipped code passed path strings as values of groupId/projectId
args, which expect [ID!] node GIDs. Filter now resolves
group(fullPath:) / project(fullPath:) to a GID before the query
runs.
3. Todo target selection only handled Issue/MergeRequest/Epic — todos
targeting WorkItem, Commit, Alerts, etc. came back as empty objects.
Target now selects __typename + name/webUrl on the Todoable
interface, with inline fragments kept for the common types.
Also exposes filter args that already existed in the schema:
- list_my_todos: authorIds, isSnoozed, sort
- mark_all_todos_done: groupPath/projectPath/action/type/authorIds/targetId
And adds Todo.targetUrl + note + snoozedUntil to the list_my_todos
response (schema-guarded for older self-hosted GitLab).
All three corrected shapes were round-tripped against the live GitLab
schema before merging.
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
Three bugs in the todo tools shipped in 1.16.0 — none caught because the GraphQL strings were never executed against a real GitLab. All three corrected shapes were round-tripped against the live schema via this MCP's own
execute_custom_querybefore commit.Fixed
mark_all_todos_donewas completely broken. Selected a non-existentupdatedIdsfield onTodosMarkAllDonePayload; every call returnedField 'updatedIds' doesn't exist on type 'TodosMarkAllDonePayload'. Real payload istodos { id state }.list_my_todosgroupPath/projectPathfilters were silently dropped. Shipped code passed path strings as the value of thegroupId/projectIdargs, which expect[ID!]node GIDs. Now resolves paths to GIDs viagroup(fullPath:)/project(fullPath:)before the todos query — matches the "introspect-then-query" pattern raised in review.targetselection only covered 3 of the Todoable types. Issues, MRs, Epics worked; WorkItem/Commit/Alerts/etc came back as empty objects. Now selects on theTodoableinterface (__typename,name,webUrl) with the existing inline fragments retained for common types.Added (filters/fields already in the schema, not surfaced)
list_my_todos:authorIds,isSnoozed,sortargs;targetUrl,note { id body },snoozedUntilfields in the response (schema-guarded for older GitLab).mark_all_todos_done: optionalgroupPath/projectPath/action/type/authorIds/targetIdto scope which pending todos get marked done. With no args it still marks everything pending as before.Process note
This slipped through because PR #35 had no live-GitLab smoke test. Following up separately on tightening the PR checklist (introspect output + Inspector smoke test required for new GraphQL tools) — captured in the conversation that led to this PR.
Test plan
npm run buildcleanTodosMarkAllDonepayload shape round-tripped against live GitLab — no schema errorcurrentUser.todosselection with all new fields round-tripped — returned real data includingtargetUrl,note,snoozedUntil,target.__typenamegroup(fullPath:)→ GID resolution round-tripped