Skip to content

fix(mcp): send the task-position API the fields it reads - #629

Merged
pikann merged 2 commits into
Paca-AI:masterfrom
bfs2021:fix/mcp-task-position-fields
Oct 24, 2026
Merged

pikann merged 2 commits into
Paca-AI:masterfrom
bfs2021:fix/mcp-task-position-fields

Conversation

@bfs2021

@bfs2021 bfs2021 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #610, option 1 from the issue.

Problem

move_task and bulk_move_tasks PUT { target_view_id, target_status_id, target_position } to the task-positions routes. The API reads { position, group_key } (and { items: [...] } for the bulk route), so it bound position: 0 and ignored the rest, while the tools replied "Task moved successfully".

Fix

  • move_task now takes projectId, viewId, taskId, position, optional groupKey, and PUTs { position, group_key } to /views/{viewId}/task-positions/{taskId}.
  • bulk_move_tasks takes projectId, viewId, items: [{ taskId, position, groupKey? }] and PUTs { items } to /views/{viewId}/task-positions.
  • Tool descriptions say these set a task's order within one view; sprint/status changes stay with update_task.
  • PacaAPIViewsClient gains moveTaskPosition; bulkMoveTasks now calls the bulk route. The duplicated MoveTaskInput type is replaced accordingly.

Testing

  • npx vitest run in apps/mcp: 631 passed.
  • src/__tests__/api/views-client.test.ts asserts both request URLs and bodies; src/__tests__/tools/view-tools.test.ts asserts the new schemas, mapping and replies (including that move_task no longer calls the bulk method).
  • npx tsc --noEmit reports four errors in unrelated files (zod inference in other tool schemas), none in the files this PR touches.

move_task and bulk_move_tasks sent target_view_id/target_status_id/target_position, which the task-positions endpoint ignores, so it set the source view's position to 0 and the tools still reported success. Option 1 from the issue: move_task now PUTs {position, group_key} to the single-task route, bulk_move_tasks PUTs {items:[{task_id,position,group_key}]} to the bulk route, and both schemas/descriptions say they set a task's order within a view. Sprint/status moves stay with update_task.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one small consolidation suggestion inline, plus a docs note below. The fix matches the API contract and is well covered by tests.

Reviewed changes

  • move_task and bulk_move_tasks now match the API wire contract — move_task takes {projectId, viewId, taskId, position, groupKey?} and PUTs {position, group_key} to /views/{viewId}/task-positions/{taskId}; bulk_move_tasks takes items: [{taskId, position, groupKey?}] and PUTs {items} to /views/{viewId}/task-positions. Descriptions now state these set a task's order within one view (sprint/status stay with update_task), and both replies report what changed.
  • PacaAPIViewsClient updated — new moveTaskPosition; bulkMoveTasks rewritten to hit the bulk route with an items body.
  • Type changes — removed the duplicated MoveTaskInput; BulkMoveTasksInput is now the items array; added MoveTaskPositionInput.
  • Tests — both routes asserted by URL and body, plus tool-level schema/mapping/reply assertions (including that move_task no longer calls the bulk method).

I verified the contract against services/api/internal/transport/http/dto/view_dto.go (MoveTaskRequest{position, group_key}, BulkMoveTasksRequest{items}), the routes in router.go:622-624, and the 204 responses the client already handles. The two touched suites pass (83 tests), npm run lint is clean, and the npx tsc --noEmit errors are confined to the unrelated member-tools.ts.

ℹ️ Tool reference docs still describe the pre-fix behavior

The tool descriptions in view-tools.ts were updated to make clear these tools only set an order within a view, but the tool documentation was not. docs/guides/mcp-server-setup.md:197 still tells users bulk_move_tasks "Moves all tasks to the new sprint" — the exact misunderstanding behind #610 — and apps/mcp/README.md:329 / apps/mcp/ALL_TOOLS.md:75-76 still describe them as generic moves. Updating the setup example is worth doing while the semantics are fresh.

Technical details
# Stale tool docs after the semantic fix

## Affected sites
- `docs/guides/mcp-server-setup.md:197` — "`bulk_move_tasks` - Moves all tasks to the new sprint" (never true, and contradicts the new description)
- `apps/mcp/README.md:329` — "`bulk_move_tasks` - Bulk move tasks in a view"
- `apps/mcp/ALL_TOOLS.md:75-76` — generic "move" wording for both tools

## Required outcome
- Docs reflect that both tools set a task's manual position within a single view, and that sprint/status changes use `update_task`.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/mcp/src/api/views-client.ts Outdated
bulkMoveTasks now delegates to bulkMoveViewTaskPositions so the items contract lives in one place, and the setup guide, README and ALL_TOOLS stop calling these tools sprint moves: they set a task's manual position in one view, and sprint/status changes use update_task.
@bfs2021

bfs2021 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Done in db7d522: bulkMoveTasks now delegates to bulkMoveViewTaskPositions, and the setup guide, apps/mcp/README.md and ALL_TOOLS.md say these tools set a task position within one view, with update_task named for sprint/status changes. npx vitest run still passes (631).

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This run re-reviewed the delta since the prior pullfrog review (commit db7d522). Both prior concerns are addressed.

  • bulkMoveTasks now delegates — PacaAPIViewsClient.bulkMoveTasks calls bulkMoveViewTaskPositions(projectId, viewId, input.items) instead of duplicating the { items } PUT, so the bulk contract lives in one place.
  • Tool docs reworded — apps/mcp/README.md, apps/mcp/ALL_TOOLS.md, and docs/guides/mcp-server-setup.md now describe move_task / bulk_move_tasks as setting a task's manual position within a view, with sprint/status changes handled by update_task.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit 3b976b8 into Paca-AI:master Oct 24, 2026
2 checks passed
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.

[Bug] MCP: move_task and bulk_move_tasks send fields the task-positions API ignores

2 participants