|
14 | 14 | from cyt_mcp.config import AggregatorConfig, load_known_mcp_server_keys |
15 | 15 | from cyt_mcp.config_holder import ConfigHolder |
16 | 16 | from cyt_mcp.runtime_cache import RuntimeToolCache |
17 | | -from cyt_mcp.search import MCP_WIRE_SEARCH_TOOL_NAME, SEARCH_TOOL_NAME |
| 17 | +from cyt_mcp.search import is_meta_tool |
18 | 18 | from cyt_mcp.session_context import get_current_session_runtime |
19 | 19 | from cyt_mcp.tier_feedback_push import schedule_tool_use_feedback |
20 | 20 | from cyt_mcp.tool_identity import canonical_backend_identity, resolve_backend_identity |
21 | 21 |
|
22 | 22 | logger = logging.getLogger(__name__) |
23 | 23 |
|
24 | | -_META_TOOL_NAMES = frozenset( |
25 | | - { |
26 | | - SEARCH_TOOL_NAME, |
27 | | - MCP_WIRE_SEARCH_TOOL_NAME, |
28 | | - "cyt-mcp_get-tool-definitions", |
29 | | - }, |
30 | | -) |
31 | | - |
32 | | - |
33 | | -def _is_meta_tool(tool_name: str) -> bool: |
34 | | - normalized = tool_name.strip() |
35 | | - if not normalized: |
36 | | - return True |
37 | | - if normalized in _META_TOOL_NAMES: |
38 | | - return True |
39 | | - return normalized.endswith(("_get-tool-definitions", "__get-tool-definitions")) |
40 | | - |
41 | | - |
42 | 24 | def _tool_call_succeeded(result: ToolResult) -> bool: |
43 | 25 | if getattr(result, "is_error", False): |
44 | 26 | return False |
@@ -105,7 +87,7 @@ async def on_call_tool( |
105 | 87 | arguments = getattr(params, "arguments", None) |
106 | 88 | args = dict(arguments) if isinstance(arguments, dict) else {} |
107 | 89 |
|
108 | | - if _is_meta_tool(tool_name): |
| 90 | + if is_meta_tool(tool_name): |
109 | 91 | return await call_next(context) |
110 | 92 |
|
111 | 93 | success = False |
|
0 commit comments