Skip to content

Commit bd28adb

Browse files
committed
ruff & mypy
1 parent 1ba4db5 commit bd28adb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

fastapi_mcp/http_tools.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from fastapi import FastAPI
1313
from fastapi.openapi.utils import get_openapi
1414
from mcp.server.fastmcp import FastMCP
15-
from pydantic import Field
1615

1716
from .openapi_utils import (
1817
clean_schema_for_display,
@@ -433,7 +432,7 @@ async def http_tool_function_template(**kwargs):
433432

434433
# Create the http_tool_function (with name and docstring)
435434
additional_variables = {"path_params": path_params, "query_params": query_params, "header_params": header_params}
436-
http_tool_function = _create_http_tool_function(http_tool_function_template, properties, additional_variables)
435+
http_tool_function = _create_http_tool_function(http_tool_function_template, properties, additional_variables) # type: ignore
437436
http_tool_function.__name__ = operation_id
438437
http_tool_function.__doc__ = tool_description
439438

fastapi_mcp/openapi_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ def parse_param_schema_for_python_type_and_default(param_schema: Dict[str, Any])
129129
types.remove("null")
130130
if types:
131131
return f"Optional[{OPENAPI_PYTHON_TYPES_MAP.get(next(iter(types)), 'Any')}] = None", True
132-
return f"Optional[str] = None", True
132+
return "Optional[str] = None", True
133133
return f"Union[{', '.join([OPENAPI_PYTHON_TYPES_MAP.get(t, 'Any') for t in types])}]", False
134134

135135
# Handle direct type specification
136-
python_type = OPENAPI_PYTHON_TYPES_MAP.get(param_schema.get("type"), 'Any')
136+
python_type = OPENAPI_PYTHON_TYPES_MAP.get(param_schema.get("type", ""), 'Any')
137137
default_value = param_schema.get("default")
138138
if default_value is not None:
139139
return f"{python_type} = {default_value}", True

0 commit comments

Comments
 (0)