fix(settings): log tool source resolution failures (no silent swallow)

This commit is contained in:
2026-05-04 06:37:09 +00:00
parent 272e49b6b0
commit 1da3587334

View File

@@ -4,8 +4,11 @@
from __future__ import annotations from __future__ import annotations
import inspect import inspect
import logging
from typing import Any from typing import Any
logger = logging.getLogger(__name__)
async def list_mcp_tools() -> list[dict[str, Any]]: async def list_mcp_tools() -> list[dict[str, Any]]:
"""List all registered MCP tools with metadata.""" """List all registered MCP tools with metadata."""
@@ -24,8 +27,10 @@ async def list_mcp_tools() -> list[dict[str, Any]]:
_, line = inspect.getsourcelines(fn) _, line = inspect.getsourcelines(fn)
source_location = f"{file}:{line}" source_location = f"{file}:{line}"
module = fn.__module__ module = fn.__module__
except Exception: except Exception as e:
pass logger.debug(
"tool_source_resolution_failed name=%s err=%s", t.name, e,
)
out.append({ out.append({
"name": t.name, "name": t.name,
"description": t.description or "", "description": t.description or "",