fixes for mypy

This commit is contained in:
Ishaan Jaff 2025-09-11 20:05:29 -07:00
parent 94038108ad
commit 1e230e87e3

View file

@ -70,7 +70,8 @@ async def create_mcp_list_tools_events(
mcp_tools_dict = []
for tool in filtered_mcp_tools:
if hasattr(tool, 'model_dump') and callable(getattr(tool, 'model_dump')):
mcp_tools_dict.append(tool.model_dump())
# Type cast to help mypy understand this is safe after hasattr check
mcp_tools_dict.append(cast(Any, tool).model_dump())
elif hasattr(tool, '__dict__'):
mcp_tools_dict.append(tool.__dict__)
else: