forked from rh-ecosystem-edge/assisted-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathllama-stack-mcp-tool-params.patch
More file actions
21 lines (20 loc) · 1.05 KB
/
llama-stack-mcp-tool-params.patch
File metadata and controls
21 lines (20 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/llama_stack/providers/utils/tools/mcp.py b/llama_stack/providers/utils/tools/mcp.py
index fc8e2f37..79722197 100644
--- a/llama_stack/providers/utils/tools/mcp.py
+++ b/llama_stack/providers/utils/tools/mcp.py
@@ -114,12 +114,15 @@ async def list_mcp_tools(endpoint: str, headers: dict[str, str]) -> ListToolDefs
tools_result = await session.list_tools()
for tool in tools_result.tools:
parameters = []
+ required_params = tool.inputSchema.get("required", [])
for param_name, param_schema in tool.inputSchema.get("properties", {}).items():
parameters.append(
ToolParameter(
name=param_name,
parameter_type=param_schema.get("type", "string"),
description=param_schema.get("description", ""),
+ required=param_name in required_params,
+ default=param_schema.get("default", None),
)
)
tools.append(