INNER CODE UNIT · Python

call_tool

FuzzingLabs/mcp-security-hub · binary-analysis/capa-mcp/server.py:251

async def call_tool(name: str, arguments: dict[str, Any]) -> list[TextContent]:
    try:
        if name == "capa_analyze":
            if len(active_scans) >= settings.max_concurrent_scans:
                return [TextContent(type="text", text="Max concurrent scans reached.")]

            filepath = arguments["filepath"]
            if not Path(filepath).exists():
                return [TextContent(type="text", text=f"File not found: {filepath}")]

            result = await run_capa_analysis(
                filepath=filepath,
                timeout=arguments.get("timeout"),
            )
            return [TextContent(type="text", text=json.dumps(format_analysis_summary(result), indent=2))]

        elif name == "get_analysis_results":
            result = scan_results.get(arguments["scan_id"])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…