Skip to content

fix: correct todo tool GraphQL shapes (1.18.0)#38

Merged
ttpears merged 1 commit into
mainfrom
fix/todo-tools-correctness
May 22, 2026
Merged

fix: correct todo tool GraphQL shapes (1.18.0)#38
ttpears merged 1 commit into
mainfrom
fix/todo-tools-correctness

Conversation

@ttpears
Copy link
Copy Markdown
Owner

@ttpears ttpears commented May 22, 2026

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_query before commit.

Fixed

  1. mark_all_todos_done was completely broken. Selected a non-existent updatedIds field on TodosMarkAllDonePayload; every call returned Field 'updatedIds' doesn't exist on type 'TodosMarkAllDonePayload'. Real payload is todos { id state }.
  2. list_my_todos groupPath / projectPath filters were silently dropped. Shipped code passed path strings as the value of the groupId / projectId args, which expect [ID!] node GIDs. Now resolves paths to GIDs via group(fullPath:) / project(fullPath:) before the todos query — matches the "introspect-then-query" pattern raised in review.
  3. target selection only covered 3 of the Todoable types. Issues, MRs, Epics worked; WorkItem/Commit/Alerts/etc came back as empty objects. Now selects on the Todoable interface (__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, sort args; targetUrl, note { id body }, snoozedUntil fields in the response (schema-guarded for older GitLab).
  • mark_all_todos_done: optional groupPath / projectPath / action / type / authorIds / targetId to 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 build clean
  • Corrected TodosMarkAllDone payload shape round-tripped against live GitLab — no schema error
  • Corrected currentUser.todos selection with all new fields round-tripped — returned real data including targetUrl, note, snoozedUntil, target.__typename
  • group(fullPath:) → GID resolution round-tripped
  • CI green
  • After merge: smoke test the published v1.18.0 against Claude Desktop

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.
@ttpears ttpears merged commit 674a1a0 into main May 22, 2026
2 checks passed
@ttpears ttpears deleted the fix/todo-tools-correctness branch May 22, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant