Skip to content

Commit 5e0e00f

Browse files
BryceRyanandrew-lastmile
authored andcommitted
Update logger in tool filtering to prevent crashing (lastmile-ai#559)
* Update agent.py * Swapping to debug logging instead of trace logging
1 parent 3f55f11 commit 5e0e00f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/mcp_agent/agents/agent.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,9 @@ def _annotate_span_for_tools_result(result: ListToolsResult):
709709
f"Filtered tools: {[name for name, _ in filtered_out_tools[:10]]}"
710710
+ ("..." if len(filtered_out_tools) > 10 else "")
711711
)
712-
# Log detailed reasons at trace level (if trace logging is available)
713-
if logger.isEnabledFor(10): # TRACE level is usually 10
714-
for tool_name, reason in filtered_out_tools:
715-
logger.log(10, f"Filtered out '{tool_name}': {reason}")
712+
713+
for tool_name, reason in filtered_out_tools:
714+
logger.debug(f"Filtered out '{tool_name}': {reason}")
716715
else:
717716
logger.debug(
718717
f"Tool filter applied: All {len(result.tools)} tools passed the filter"

0 commit comments

Comments
 (0)