Spaces:
Runtime error
Runtime error
Eddyhzd
commited on
Commit
·
662ab90
1
Parent(s):
fb13585
reformat tools
Browse files
app.py
CHANGED
|
@@ -46,11 +46,14 @@ class MCPClientWrapper:
|
|
| 46 |
await self.session.initialize()
|
| 47 |
|
| 48 |
response = await self.session.list_tools()
|
| 49 |
-
self.tools = [{
|
| 50 |
-
"
|
| 51 |
-
"
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
tool_names = [tool["name"] for tool in self.tools]
|
| 56 |
return f"Connected to MCP server. Available tools: {', '.join(tool_names)}"
|
|
|
|
| 46 |
await self.session.initialize()
|
| 47 |
|
| 48 |
response = await self.session.list_tools()
|
| 49 |
+
self.tools = [{
|
| 50 |
+
"type": "function",
|
| 51 |
+
"function":{
|
| 52 |
+
"name": tool.name,
|
| 53 |
+
"description": tool.description,
|
| 54 |
+
"input_schema": tool.inputSchema
|
| 55 |
+
}
|
| 56 |
+
} for tool in response.tools]
|
| 57 |
|
| 58 |
tool_names = [tool["name"] for tool in self.tools]
|
| 59 |
return f"Connected to MCP server. Available tools: {', '.join(tool_names)}"
|