Skip to content

feat(#820): MCP rate_entry tool — in-session knowledge feedback#823

Merged
magicpro97 merged 3 commits into
mainfrom
feat/i820-rate-entry
May 31, 2026
Merged

feat(#820): MCP rate_entry tool — in-session knowledge feedback#823
magicpro97 merged 3 commits into
mainfrom
feat/i820-rate-entry

Conversation

@magicpro97
Copy link
Copy Markdown
Owner

Implements #820. Adds rate_entry MCP tool (good/bad/neutral verdict + optional note). Wires into existing search_feedback table. Closes #820

Copilot AI review requested due to automatic review settings May 31, 2026 08:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an MCP rate_entry tool so agents can record good/bad/neutral feedback (with an optional note) on knowledge entries inline, and adds a migration that introduces a note column on search_feedback to back the optional note field.

Changes:

  • Register a new rate_entry MCP tool schema and dispatch entry in mcp-server.py.
  • Implement _run_rate_entry to validate input, look up the entry, and INSERT a row into search_feedback with result_kind='knowledge' and the new note column.
  • Add migration v37 to migrate.py adding search_feedback.note TEXT.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
mcp-server.py Adds the rate_entry tool schema, handler, and dispatch wiring.
migrate.py Adds migration v37 introducing search_feedback.note to back optional rating notes.

Comment thread mcp-server.py
Comment thread mcp-server.py
Comment thread mcp-server.py
@magicpro97 magicpro97 force-pushed the feat/i820-rate-entry branch from f24d2f4 to 578a025 Compare May 31, 2026 08:39
Linh Ngo and others added 3 commits May 31, 2026 15:49
- New rate_entry MCP tool: entry_id + verdict (good/bad/neutral) + optional note
- Migration 37: ADD COLUMN note TEXT to search_feedback table
- _run_rate_entry(): validates entry exists, writes to search_feedback with score ±1/0
- Wired into _handle_tools_call() dispatch
- Closes the agent feedback loop without requiring a separate CLI call

Closes #820

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion test

- Add _check_auth(arguments) to _run_rate_entry (security fix)
- Change feedback query from 'mcp:rate_entry:{id}' to '*' so briefing
  bias applies universally to rated entries regardless of query context
- Update briefing._apply_feedback_bias_to_knowledge to honor '*' query
- Add TestRateEntryExecution test class with feedback write verification
@magicpro97 magicpro97 force-pushed the feat/i820-rate-entry branch from f1898e0 to 2a40fa6 Compare May 31, 2026 08:49
@magicpro97 magicpro97 merged commit b36afe0 into main May 31, 2026
19 of 34 checks passed
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.

feat(mcp): rate_entry MCP tool — in-session interactive knowledge feedback without CLI

2 participants