fix(mcp): expose context_type filter#3181
Open
huangruiteng wants to merge 2 commits into
Open
Conversation
Contributor
Author
Collaborator
|
context_type可以支持,但是fileter不用支持 |
Contributor
Author
|
已按 review 收缩:保留 |
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.
动机
修复 #2990。
MCP 的
find和search目前无法按context_type限定检索范围,而 REST、SDK、CLI 与底层 search service 已支持该输入。调用方因此只能依赖 URI 前缀等方式绕行。根据 maintainer review,本 PR 只补齐
context_type,不向 MCP 暴露通用 metadatafilter。改动思路
复用现有 search-filter normalization,把 MCP 的可选
context_type转为底层 effective filter,再传给SearchService.find/SearchService.search。不传该参数时行为保持不变,非法输入继续返回InvalidArgumentError。关键调用链 / 伪代码
具体改动
context_type;filter;修复后复现建议
通过 MCP 分别调用
find/search:修复前 MCP schema 不接受该参数;修复后 schema 会暴露
context_type,service 收到对应 effective filter。省略参数时结果与修复前一致,schema 中仍不包含通用filter。验证
tests/server/test_mcp_endpoint.py:49 passed;find/search包含context_type,不包含filter;git diff --check:passed。对主干的风险与未覆盖
改动仅涉及 MCP 输入与既有 search service 参数传递;不传新参数时保持原行为。本 PR 不增加 metadata
filter、tag 或 time-range 快捷参数。