Log MCP tool loading outcome (fetching, loaded names, or failure with traceback)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -307,14 +307,18 @@ class AIService:
|
||||
return self._mcp_tool_schemas or []
|
||||
self._mcp_tools_fetched = True
|
||||
if self.config.image_understand is None:
|
||||
log.info("MCP tools: image_understand not configured, skipping")
|
||||
self._mcp_tool_schemas = []
|
||||
return []
|
||||
log.info("MCP tools: fetching tool list from %s", self.config.image_understand.command)
|
||||
try:
|
||||
async with MinimaxImageUnderstandClient(self.config.image_understand) as mcp_client:
|
||||
raw = await mcp_client.list_tools()
|
||||
self._mcp_tool_schemas = mcp_tools_to_openai_schemas(raw)
|
||||
names = [s["function"]["name"] for s in self._mcp_tool_schemas]
|
||||
log.info("MCP tools: loaded %d tool(s): %s", len(names), ", ".join(names) or "(none)")
|
||||
except Exception:
|
||||
log.warning("Failed to fetch MCP tool schemas; MiniMax tools will be unavailable")
|
||||
log.warning("MCP tools: failed to load, MiniMax tools will be unavailable", exc_info=True)
|
||||
self._mcp_tool_schemas = []
|
||||
return self._mcp_tool_schemas or []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user