feat(agent-mcp): expose tag categories to MCP - #923
Merged
Conversation
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Pull request overview
Exposes tag category operations and richer tag metadata to the Agent MCP surface so MCP clients can both discover categories and manage them via the existing desktop write-approval flow, while also preventing vault_get_tags from discarding category/color/icon/sort-order data.
Changes:
- Added
tags.listCategoriesto the MCP desktop read allowlist, and category write ops (createCategory,renameCategory,deleteCategory,reorder) to the write allowlist (approval-gated). - Extended the
vault_get_tagsreturn shape to includecolor,icon,sort_order,category_id, andcategory_name(joining category names vialistTagCategories). - Updated tests and docs to reflect the newly exposed operations and expanded tag metadata.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/contracts/src/agent-mcp-channels.ts | Allowlists new tag-category desktop operations for MCP read/write bridging. |
| packages/contracts/src/agent-mcp-channels.test.ts | Adds allowlist coverage ensuring category ops are exposed in the correct list(s). |
| apps/docs/src/user-guide/ai/agent-mcp.md | Documents tag-category operations and expanded vault_get_tags fields for MCP users. |
| apps/desktop/src/main/agent/mcp/tools/schemas.ts | Updates vault_get_tags tool description to reflect expanded tag metadata. |
| apps/desktop/src/main/agent/mcp/tools/handles.ts | Widens the TagCount tool-facing type to include category/color/icon/sort metadata. |
| apps/desktop/src/main/agent/mcp/tools/handles-adapter.ts | Stops discarding tag metadata; joins category name from listTagCategories. |
| apps/desktop/src/main/agent/mcp/tools/handles-adapter.test.ts | Verifies adapter preserves category/color/icon/sort fields and category-name join behavior. |
| apps/desktop/src/main/agent/mcp/tools/tests/read-tools.test.ts | Updates vault_get_tags tool test to assert the expanded tag metadata is returned. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+235
to
+237
| Tag categories are reachable through the same bridge. `tags.listCategories` is a read operation that | ||
| returns each category with its id, name, sort order, and tag count. `tags.createCategory`, | ||
| `tags.renameCategory`, `tags.deleteCategory`, and `tags.reorder` are write operations behind the |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
h4yfans
added a commit
that referenced
this pull request
Aug 3, 2026
Review feedback on #923: the desktop bridge returns the raw IPC envelope, so tags.listCategories yields { success, categories } rather than a bare list. Name the shape for each category operation and note that failures come back as { success: false, error } instead of an MCP error.
h4yfans
added a commit
that referenced
this pull request
Aug 3, 2026
Review feedback on #923: the desktop bridge returns the raw IPC envelope, so tags.listCategories yields { success, categories } rather than a bare list. Name the shape for each category operation and note that failures come back as { success: false, error } instead of an MCP error.
h4yfans
force-pushed
the
mcp-tag-categories
branch
from
August 3, 2026 11:05
c655b14 to
6acd184
Compare
h4yfans
marked this pull request as ready for review
August 3, 2026 11:15
Tag categories, the tag hub, and the single-tag page shipped in #901 but were unreachable from MCP, and vault_get_tags narrowed each tag down to name + count so an agent could not even tell that categories exist. - allowlist tags.listCategories as a desktop read operation - allowlist tags.createCategory / renameCategory / deleteCategory / reorder as write operations, so they run behind write approval - widen TagCount with color, icon, sort_order, category_id and category_name; getAllTagsWithCounts already carries every field except the category name, which the adapter joins from listTagCategories Closes #918
Review feedback on #923: the desktop bridge returns the raw IPC envelope, so tags.listCategories yields { success, categories } rather than a bare list. Name the shape for each category operation and note that failures come back as { success: false, error } instead of an MCP error.
h4yfans
force-pushed
the
mcp-tag-categories
branch
from
August 3, 2026 11:15
6acd184 to
559f3fb
Compare
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.
What
tags.listCategoriesas an agent desktop read operationtags.createCategory/renameCategory/deleteCategory/reorderas write operations, so they run behind the existing write-approval flowTagCountwithcolor,icon,sort_order,category_id,category_nameand stop the adapter discarding themWhy
Tag categories shipped in #901 but were unreachable from MCP, and
vault_get_tagsnarrowed each tag to name + count — an agent could not tell categories existed.getAllTagsWithCountsalready carries every field except the category name, which the adapter now joins fromlistTagCategories.Closes #918