Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
repoYesGitHub repository name (e.g., 'sdk')
ownerYesGitHub repository owner (e.g., 'modelcontextprotocol')
trigger_scanNoIf true, triggers CodeQL workflow then polls for results before returning alerts
poll_timeout_secondsNoMax seconds to wait for CodeQL scan completion (default 300)
poll_interval_secondsNoSeconds between poll attempts (default 15)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
alertsYes
warningNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv1.1.7
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "alerts": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "alert_number": {
      +            "type": "number"
      +          },
      +          "created_at": {
      +            "type": "string"
      +          },
      +          "end_line": {
      +            "type": "number"
      +          },
      +          "html_url": {
      +            "type": "string"
      +          },
      +          "message_text": {
      +            "type": "string"
      +          },
      +          "most_recent_instance_path": {
      +            "type": "string"
      +          },
      +          "most_recent_instance_start_line": {
      +            "type": "number"
      +          },
      +          "rule_description": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "rule_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "severity": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "state": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "rule_id",
      +          "severity",
      +          "rule_description",
      +          "state",
      +          "html_url",
      +          "alert_number",
      +          "created_at"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "warning": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "alerts"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv1.1.4
    • changedInput schema / properties / owner / description
      Previous value: -"GitHub repository owner"New value: +"GitHub repository owner (e.g., 'modelcontextprotocol')"
    • changedInput schema / properties / repo / description
      Previous value: -"GitHub repository name"New value: +"GitHub repository name (e.g., 'sdk')"
  3. First observedv1.1.3

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description fully discloses the conditional side effect: 'Read-only by default. If trigger_scan=true, writes to GitHub Actions by creating a workflow_dispatch event.' It also adds auth requirements, rate limit awareness, and return shape, which is substantial behavioral context. The annotations are consistent: readOnlyHint=false correctly reflects the optional write behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with clear bullets and front-loads the core purpose before side effects, data sources, auth, return shape, and usage guidance. Every section earns its place and is written efficiently for an agent to consume.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, annotations, an output schema, and sibling tools, the description is exceptionally complete. It covers side effects, auth, rate limits, return shape, polling behavior, and explicit routing to alternatives. No critical operational context is missing for an agent to select and invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% parameter description coverage, so the baseline is appropriately 3. The description adds minimal extra parameter meaning beyond what the schema already provides, though the side-effect explanation for trigger_scan is helpful. It does not meaningfully enhance understanding of owner, repo, poll_timeout_seconds, or poll_interval_seconds beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's specific verb and resource: 'Fetches or triggers open Code Scanning (CodeQL) alerts for a GitHub repository.' This distinguishes it from the available sibling tools, especially when combined with the explicit usage guidelines naming alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly narrows usage to 'deep static code vulnerability scanning (CodeQL)' and gives direct exclusions with sibling alternatives: analyze_dependencies for package vulnerabilities, get_health_score for A-F grading, and check_ci_status for CI/CD statuses. This is explicit when-to-use and when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexbypa/github-projectpulse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server