From a1361e07c16b99e90d51bcdcfda982b668840b10 Mon Sep 17 00:00:00 2001 From: Airia Open Source Date: Wed, 21 Oct 2026 12:57:11 +0000 Subject: [PATCH] fix(guardrails): read the logged call type without an untyped attribute access --- litellm/proxy/guardrails/guardrail_hooks/airia/airia.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py b/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py index d0f6c3a2ccd..d41398e406c 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py +++ b/litellm/proxy/guardrails/guardrail_hooks/airia/airia.py @@ -98,7 +98,8 @@ def _mcp_tool_name(request_data: Mapping[str, object], logging_obj: "LiteLLMLogg The logger's call type wins when there is one, because a chat client can put MCP keys in its request body. """ - if logging_obj is not None and logging_obj.call_type not in MCP_GUARDRAIL_CALL_TYPES: + logged_call_type: Final[object] = getattr(logging_obj, "call_type", None) + if logging_obj is not None and logged_call_type not in MCP_GUARDRAIL_CALL_TYPES: return None pre_call_name: Final = request_data.get("mcp_tool_name") if isinstance(pre_call_name, str) and pre_call_name: