add mcp get_attack_event tool

This commit is contained in:
Changzhi Li
2025-04-07 07:41:42 +00:00
parent b7449480b3
commit 8de97ff483
6 changed files with 54 additions and 6 deletions

View File

@@ -15,7 +15,21 @@ def check_slce_response(response: httpx.Response) -> str:
return "success"
async def post_slce_api(path: str,req_body: dict) -> str:
async def get_slce_api(path: str) -> str:
if not path.startswith("/"):
path = f"/{path}"
try:
async with AsyncClient(verify=False) as client:
response = await client.get(f"{GLOBAL_CONFIG.SAFELINE_ADDRESS}{path}", json=req_body, headers={
"X-SLCE-API-TOKEN": f"{GLOBAL_CONFIG.SAFELINE_API_TOKEN}"
})
return check_slce_response(response)
except Exception as e:
return str(e)
async def post_slce_api(path: str, req_body: dict) -> str:
if not path.startswith("/"):
path = f"/{path}"