Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -161,8 +161,19 @@ async def mcp_sse_endpoint(request: Request):
|
|
| 161 |
tool_name = body.get("params", {}).get("name")
|
| 162 |
arguments = body.get("params", {}).get("arguments", {})
|
| 163 |
|
| 164 |
-
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
result = tool_func(**arguments)
|
| 167 |
|
| 168 |
return JSONResponse({
|
|
|
|
| 161 |
tool_name = body.get("params", {}).get("name")
|
| 162 |
arguments = body.get("params", {}).get("arguments", {})
|
| 163 |
|
| 164 |
+
# Directly call the tool functions we defined
|
| 165 |
+
tool_map = {
|
| 166 |
+
"search_company": search_company,
|
| 167 |
+
"get_company_info": get_company_info,
|
| 168 |
+
"get_company_filings": get_company_filings,
|
| 169 |
+
"get_financial_data": get_financial_data,
|
| 170 |
+
"extract_financial_metrics": extract_financial_metrics,
|
| 171 |
+
"get_latest_financial_data": get_latest_financial_data,
|
| 172 |
+
"advanced_search_company": advanced_search_company
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
if tool_name in tool_map:
|
| 176 |
+
tool_func = tool_map[tool_name]
|
| 177 |
result = tool_func(**arguments)
|
| 178 |
|
| 179 |
return JSONResponse({
|