Repository navigation
feat(mcp): edit, merge and undo entities and topics from agents - #389
Merged
Merged
Conversation
MCP gains edit_entity, edit_topic, merge_topics, delete_topic, undo_topic_change and undo_graph_change, calling the same routes (and checks) as the web app with a write-scope token. The assistant proposes topic merges, renames, definitions and deletes for approval (propose_topic_change), approvable in a chat room like entity changes. Approving clears the graph cache so the change shows at once. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
…nions The prose gained a row for the entity and topic curation tools; the companions now list the same entry point and carry the prose's hash. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822
Merged
16 of 22 tasks
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.
Requested by Adeel · project thread
Description
Before: an agent over MCP could merge entities, but couldn't rename, retype or hide one, couldn't touch topics at all, and couldn't take a change back. The assistant could propose entity changes but not topic ones.
After: MCP has
edit_entity(rename, retype, add aliases, hide),edit_topic(rename, define),merge_topics,delete_topic,undo_topic_changeandundo_graph_change. They need a write-scope token and call the same routes, with the same checks, as the web app.merge_topicsanddelete_topicanswer with anundo_idforundo_topic_change,undo_graph_changetakes back a merge or link made withpropose_graph_change, and a rename or hide is undone by another edit. The assistant gainspropose_topic_change(merge, rename, define, delete), which waits for the user's approval like entity changes do, in the app or a chat room. Approving clears the graph cache so the change shows at once.How:
app/api/mcp_tools.pyadds the tools on top of the entity, topic and graph-history routes;app/domain/ai_tools.pyadds the proposal tool and its carry-out;app/domain/bridge.pylets chat rooms approve it;routes/chats.pyclears the graph cache after an approval. The model settings list and the chat step labels name the new tool.Motivation and Context
Adeel: "No easy way to merge and edit entities, topics etc. Should be as easy as from the graph explorer and canvas." Agent-first: the last of the small PRs after the entities page (#384), the graph (#386), topic undo (#387) and a recording's Entities tab (#388).
Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_mcp.pyediting topics and entities and undoing;tests/api/test_topics.pythe assistant proposing topic changes)docs/accordingly. (docs/mcp.md,docs/topics.md,docs/assistant.md,docs/chat-rooms.md)## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
.envedit or manual step; the tools appear for write-scope tokens.threat-model.mdhas a row for the curation tools.make openapi)🤖 Generated with Claude Code
https://claude.ai/code/session_01EzVhJCpwskyo5NhHEtS822