get_analysis_results
Retrieve analysis results from Cyberbro API using a specific analysis ID to get threat intelligence about Indicators of Compromise.
Instructions
Retrieve the results of a previous analysis by analysis_id. Args: analysis_id: Analysis ID to retrieve results for. Returns: The analysis results from Cyberbro API.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analysis_id | Yes |
Implementation Reference
- src/mcp_cyberbro/tools/analysis.py:48-62 (handler)The `get_analysis_results` tool handler. It is an async function registered via `@mcp.tool()` decorator. It takes an `analysis_id` string parameter, makes a GET request to `{config.cyberbro_api}/results/{analysis_id}` via `get_json()`, and returns the analysis results from the Cyberbro API. Errors are caught and returned as an error dict.
@mcp.tool() async def get_analysis_results(analysis_id: str) -> Any: """ Retrieve the results of a previous analysis by analysis_id. Args: analysis_id: Analysis ID to retrieve results for. Returns: The analysis results from Cyberbro API. """ try: return await get_json( f"{config.cyberbro_api}/results/{analysis_id}", verify=config.ssl_verify ) except Exception as exc: return {"error": f"Error executing tool get_analysis_results: {exc!s}"} - src/mcp_cyberbro/server.py:14-14 (registration)Registration of all analysis tools (including get_analysis_results) via `register_analysis_tools(mcp, config)` called from `create_server()`. The tool is registered when the FastMCP server is created.
register_analysis_tools(mcp, config) - src/mcp_cyberbro/utils/http.py:13-17 (helper)The `get_json` helper function used by `get_analysis_results` to perform the HTTP GET request to the Cyberbro API endpoint.
async def get_json(url: str, verify: bool): async with httpx.AsyncClient(verify=verify) as client: response = await client.get(url) response.raise_for_status() return response.json() - The `cyberbro_api` property on `CyberbroConfig` which constructs the base API URL (`{cyberbro_url}/{api_prefix}`) used to build the full results endpoint URL.
@property def cyberbro_api(self) -> str: return f"{self.cyberbro_url}/{self.api_prefix}" - tests/test_tools_registration.py:58-58 (registration)Test that verifies the `get_analysis_results` tool is registered and functional, calling it with `'42'` and asserting the result.
results_result = await mcp.registered_tools["get_analysis_results"]("42")