Skip to main content
Glama

semgrep_scan

Read-onlyIdempotent

Run an opt-in Semgrep static security scan on a local project path to identify code security issues; requires the Semgrep CLI and BRIDGE_SEMGREP_ENABLED=1.

Instructions

Opt-in Semgrep static security scan; requires local Semgrep CLI and BRIDGE_SEMGREP_ENABLED=1.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_path": "<project_path>"
    },
    "name": "semgrep_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
project_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so safety is covered. The description adds genuinely non-obvious operational context: this depends on an external CLI and an environment flag, which is the kind of setup gating that prevents failed invocations. It stops short of saying what a scan covers, how long it takes, or what happens on missing prerequisites, so it is not a 5.

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

Conciseness4/5

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

One compact sentence with the tool's identity front-loaded and the gating conditions appended; nothing is wasted. The semicolon-separated prerequisite clause is dense but readable, and no sentence is filler.

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

Completeness3/5

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

For a single-parameter tool with no output schema and full annotation coverage, the definition covers identity and prerequisites but omits scan scope and result expectations. An agent knows it can run a security scan here but not what it will receive back or how to shape the invocation.

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

Parameters2/5

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

The single parameter project_path has 0% schema description coverage and the description says nothing about it. An agent cannot tell from either source whether this is an absolute path, a repository root, a relative directory, or how broad the scan will be, so the description fails to compensate for the schema gap.

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

Purpose4/5

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

States a specific verb and resource: a Semgrep static security scan. The 'Opt-in' qualifier and the naming of Semgrep make the tool's function unmistakable, though it does not explicitly distinguish itself from any sibling (e.g. design_audit or scan_codex_history), leaving the agent to infer that this is the code-security scanner.

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

Usage Guidelines3/5

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

The prerequisites ('requires local Semgrep CLI and BRIDGE_SEMGREP_ENABLED=1') implicitly tell the agent when the tool is usable, and 'opt-in' signals it is not a default path. However, there is no explicit statement of which situations call for this scan versus other audit siblings, and no note on what to do when the prerequisites are unmet.

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