analyze_code_scanning
Retrieve CodeQL security alerts for a GitHub repository, or trigger a new scan. Get vulnerability details by severity and location to prioritize fixes.
Instructions
Fetches or triggers open Code Scanning (CodeQL) alerts for a GitHub repository.
Side effects: Read-only by default. If trigger_scan=true, writes to GitHub Actions by creating a workflow_dispatch event.
Data sources: GitHub REST API (code-scanning/alerts and actions).
Auth requirements: Requires GITHUB_TOKEN with appropriate permissions (security-events).
Rate limits: Subject to standard GitHub API limits.
Return shape: Returns a JSON array of alert objects including rule_id, severity, rule_description, state, location paths, and html_url.
Usage guidelines: Use this tool ONLY for deep static code vulnerability scanning (CodeQL). DO NOT use this tool for other checks:
For package/dependency vulnerabilities, use 'analyze_dependencies' instead.
For a computed A-F health score grading, use 'get_health_score' instead.
For checking standard CI/CD workflow statuses, use 'check_ci_status' instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | GitHub repository name (e.g., 'sdk') | |
| owner | Yes | GitHub repository owner (e.g., 'modelcontextprotocol') | |
| trigger_scan | No | If true, triggers CodeQL workflow then polls for results before returning alerts | |
| poll_timeout_seconds | No | Max seconds to wait for CodeQL scan completion (default 300) | |
| poll_interval_seconds | No | Seconds between poll attempts (default 15) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alerts | Yes | ||
| warning | No |