fix: resolve mcpo startup fail when mcp tool parameters are missing

This commit is contained in:
chizukicn 2025-04-04 01:39:40 +08:00
parent f1b5fbd52c
commit b931e26ebb
No known key found for this signature in database
GPG Key ID: D9D1EF7A7E68B92B

View File

@ -58,7 +58,8 @@ async def create_dynamic_endpoints(app: FastAPI, api_dependency=None):
# Build Pydantic model
model_fields = {}
required_fields = schema.get("required", [])
for param_name, param_schema in schema["properties"].items():
properties = schema.get("properties", {})
for param_name, param_schema in properties.items():
param_type = param_schema.get("type", "string")
param_desc = param_schema.get("description", "")
python_type = get_python_type(param_type)