-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
37 lines (28 loc) · 786 Bytes
/
test.py
File metadata and controls
37 lines (28 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Framework for testing endpoints during development.
"""
from fastmcp import Client
import asyncio
from server import mcp
import pprint
# ========= CONFIG ===========
tool_name = "list_models"
tool_parameters = {
}
# ============================
async def main():
global tool_name, tool_parameters
async with Client(mcp) as client:
result = await client.call_tool(tool_name, tool_parameters)
if result:
if result.data:
pprint.pprint(result.data)
elif result.content:
pprint.pprint(result.content)
else:
pprint.pprint(result)
return result
print("Nothing returned from tool.")
return None
if __name__ == "__main__":
asyncio.run(main())