rust(feat): calculated channel MCP tools - #736
Draft
evan-sift wants to merge 4 commits into
Draft
Conversation
… update, and archive
…user-notes-only updates
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.
Description
Adds a
calculated_channelsdomain to the MCP server.Tool surface:
list_calculated_channels,list_calculated_channel_versions,create_calculated_channel,update_calculated_channel,archive_calculated_channel,unarchive_calculated_channel.Nested channel references ride in
expression_channel_references_json, a documented JSON string parameter, keeping every other parameter flat. Update pre-reads the channel before writing: the update mask paths cover whole configuration messages, so a mask-only write would clear sibling fields the caller never mentioned.Surface note: there is no dedicated archive RPC. The public API archives a calculated channel by setting
archived_datethrough the update mask.archive_calculated_channelandunarchive_calculated_channelare exposed as separate tools anyway, so an agent does not have to know that, and so each can carry a destructive write gate.Verification
cargo test -p sift_mcp: 50 new mock-backed tests (pagination, limit clamp, mask construction, archive/unarchive request shape, write gates, JSON parameter validation), full crate green.cargo build -p sift_mcp --no-default-features,cargo fmt --all -- --check,cargo test -p sift_cli cmd::agent: clean.list_calculated_channelsround trip, and all four write tools reject with the remediation message when the server runs without--allow-create/--allow-destructive.