Skip to content

Add typed MCP feedback outputs - #423

Closed
Lauritz-Timm wants to merge 5 commits into
rtk-ai:developfrom
Lauritz-Timm:feat/mcp-feedback-output
Closed

Add typed MCP feedback outputs#423
Lauritz-Timm wants to merge 5 commits into
rtk-ai:developfrom
Lauritz-Timm:feat/mcp-feedback-output

Conversation

@Lauritz-Timm

@Lauritz-Timm Lauritz-Timm commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Add direct typed MCP output for the feedback tool family.

Motivation

Feedback IDs and statistics are prose, while search results use a hand-built text format. Automations must regex-parse corrections and optional fields, making feedback loops fragile.

Changes

  • define feedback DTOs, typed tool markers, conversions, and schema ownership in the dedicated output/feedback.rs domain module
  • derive precise output schemas for record, search, and stats from those Rust types
  • return a typed record receipt with feedback ID and topic
  • return typed search results with context, prediction, correction, reason, source, creation time, and applied count
  • return named topic and most-applied count objects
  • represent empty results with a zero count and empty array
  • exclude embedding vectors
  • use concise modern text while preserving compact and detailed legacy text

Compatibility and safety

MCP 2024-11-05 receives the existing prose and no structured fields. Modern clients receive direct typed values. Structured JSON removes delimiter-parsing ambiguity, while the existing legacy newline-flattening defense remains.

Validation

cargo test -p icm-mcp --locked --offline feedback_
cargo test -p icm-mcp --locked --offline
cargo clippy -p icm-mcp --all-targets --locked --offline -- -D warnings
cargo fmt --all -- --check

Focused tests validate real emitted receipts, populated and empty searches, and statistics against the generated schemas. They also cover optional fields, embedding omission, named counts, exact schema allowlisting, closed objects, legacy text preservation, and newline injection.

The evaluation measured a 36.7% reduction in estimated wire tokens for seeded modern feedback search.

@Lauritz-Timm
Lauritz-Timm force-pushed the feat/mcp-feedback-output branch from 0ca979e to f1850fb Compare August 4, 2026 19:01
@Lauritz-Timm
Lauritz-Timm deleted the feat/mcp-feedback-output branch August 4, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant