Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: handle MCP tool schemas missing `properties` key gracefully (#9347)

Kian Jones31d221b47e2c
diff --git a/letta/functions/schema_generator.py b/letta/functions/schema_generator.py
index 3f549069a..de8114884 100644
--- a/letta/functions/schema_generator.py
+++ b/letta/functions/schema_generator.py
@@ -704,8 +704,9 @@ def generate_tool_schema_for_mcp(
name = mcp_tool.name
description = mcp_tool.description
- assert "type" in parameters_schema, parameters_schema
- assert "properties" in parameters_schema, parameters_schema
+ if "type" not in parameters_schema:
+ parameters_schema["type"] = "object"
+ parameters_schema.setdefault("properties", {})
# assert "required" in parameters_schema, parameters_schema
# Normalize the schema to fix common issues with MCP schemas