← All requests
1

Filter tasks by label in the task list API and MCP

OpenMCP & APIRandy Sauers ·

Summary

GET /task/tasks/{projectId} accepts status, priority, assignee, date, and pagination filters, but not label. The MCP list_tasks tool mirrors that surface. An agent cannot ask for "all tasks labelled deferred" or "all tasks labelled doc" without fetching the whole board and filtering client-side.

Motivation

  • Labels are the cross-cutting taxonomy: deferred, blocked, task, investigation, build, doc, and domain labels.
  • The UI can filter by label, but the API cannot. The UI filter is client-side, so it does not help agents or scripts.
  • Fetching the whole board to filter by label is expensive on large boards and breaks the pagination contract.
  • The MCP is the primary interface for agents; it should expose the same filter.

Proposed changes

  1. Add label (name) and/or labelId query parameters to GET /task/tasks/{projectId}.
  2. Support repeated values or a comma-separated list for multiple labels, with an any or all mode.
  3. Apply the filter before pagination, consistent with the existing filters.
  4. Add the same parameters to the MCP list_tasks tool.
  5. Optionally add the filter to the workspace-wide task list when #1959 lands.

Acceptance criteria

  • GET /task/tasks/{projectId}?label=deferred returns only tasks with the deferred label.
  • GET /task/tasks/{projectId}?label=doc,build returns tasks with either label, or both when mode=all.
  • The filter composes with status, priority, assignee, and date filters.
  • Pagination counts reflect the filtered set.
  • The MCP list_tasks accepts the same filter and returns the same set.
  • Unknown label names return an empty set, not an error, or a clear 400 if the API prefers strict validation.

Checked open issues

  • #53 advanced filtering, sorting, grouping and saved views (UI filters, not API or MCP).
  • #1959 workspace-wide task list and board with quick assignee filter (adjacent, not label).
  • #2051 saved board filter on a label bug (closed; UI bug, not API).
  • #1200 label filter shows active after refresh (closed; UI bug, not API).
  • #1490 align the label API to per-workspace labels (closed; label API shape, not filtering).

Additional context

  • Current listTasks parameters: status, priority, assigneeId, page, relatedPage, limit, sortBy, sortOrder, dueBefore, dueAfter. No label.
  • The web UI's label filter is client-side; the commit that added it touched only apps/web hooks and the board component.
  • The MCP list_tasks signature mirrors the API and has no label parameter.

Discussion 0

No comments yet.

Sign in to comment.

Keyboard shortcuts

Anywhere

Go to requests
gh
Go to changelog
gc
Go to notifications
gn
Next or previous page
norp
Leave a text field or close a menu
Esc
Show this list
?

Requests

Move to the next or previous request
jork
Open the selected request
oorEnter
Vote on the selected request
v
Search
/
New request
c

Request

Vote
v
Write a comment
c
Edit
e