Repository navigation
Feat(mcp): list_tasks says which status column each task is in, as zn mcp does - #943
Merged
Merged
Conversation
… mcp does An assistant reading tasks through the MCP server saw a task's due date, priority and tags, but not the column it sits in on a board grouped by status: a task note's `status:`, a checkbox line's `@status:`, or the status a line takes from its note's frontmatter. zn mcp reports it with ZenNotes/tui#10 (#941), so the two servers would have answered the same question differently. list_tasks now carries `status` on every task note (`open` when it has none) and on every line that has one, read the way the app reads it: the first `@status:` on a line wins and the value is lower-cased. The token stays in `content`, as every field does in this grammar, so ids and content do not change. The app's own field reader, inlineTaskField, is now exported from shared-domain and imported here rather than copied again. The legacy TypeScript CLI shares this scan, so its `task list --json` gains the field too. The tool's description names the field, and its `status` argument says it filters by state (open, done, waiting), not by that column, in the same words as zn mcp. A new test reads a task note with and without a status, a line that inherits its note's status, and one with two `@status:` tokens, and checks every line against shared-domain's parser. With the built server over stdio, list_tasks on a scratch vault returned the same ids, content and statuses as zn mcp, and tools/list showed the new descriptions.
Merged
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.
For #941, and the desktop half of ZenNotes/tui#10: an assistant reading tasks through the desktop's MCP server now sees which status column each task is in, as it does through
zn mcp.What changes
list_tasksreturnsstatuson every task note (its frontmatterstatus:,openwhen it has none) and on every checkbox line that has one (its first@status:, or thestatus:of its note's frontmatter), lower-cased. A line without one has nostatuskey.@status:incontent, as it keeps every field.inlineTaskField, the app's own field reader, is exported frompackages/shared-domain/src/tasks.tsand imported byvault-ops.tsinstead of being copied again.statusargument says it filters by state (open, done, waiting), not by that column, in the same words aszn mcp.task list --jsongainsstatustoo, matching the Gozn.Verification
npx vitest run src/mcp/(63 tests, 1 new) and shared-domain (1,994) pass; desktop and shared-domain typecheck clean.parseTasksFromBody, so the MCP server and the app cannot drift apart.out/main/mcp.js, ran it withELECTRON_RUN_AS_NODE=1on a scratch vault and calledlist_tasksover stdio: the same ids, content and statuses aszn mcpfrom Feat(tasks): zn task watch prints each task status change as it happens tui#10, andtools/listshows the new descriptions.How to test locally
Before this change no task has a
status. After it:Parserisbacklog,Write docs @status:Reviewisreview, andPlain taskhas none.zn mcpfrom ZenNotes/tui#10 gives the same answer for the same vault.