-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.py
More file actions
26 lines (23 loc) · 809 Bytes
/
Copy pathtest_api.py
File metadata and controls
26 lines (23 loc) · 809 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
import requests
# Test search
r = requests.post('http://localhost:8000/mcp', json={
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'name': 'search_research_memory', 'query': 'fundamental value alphas', 'k': 3},
'id': 2
})
result = r.json().get('result', {})
print('Results:', result.get('count'))
for x in result.get('results', [])[:3]:
print(f" {x['name']} ({x['type']}) score={x['score']}")
print()
# Test context
r2 = requests.post('http://localhost:8000/mcp', json={
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'name': 'get_research_context', 'query': 'momentum', 'k': 2, 'format': 'compact'},
'id': 3
})
result2 = r2.json().get('result', {})
print('Context tokens:', result2.get('tokens'))
print('Context preview:', result2.get('context', '')[:200])