Skip to main content
Glama

semgrep_scan

Run deterministic static analysis over repository files to substantiate suspected defects, returning exact line numbers and matched source snippets for direct review.

Instructions

Run deterministic static analysis (Semgrep) over repository files and return findings with exact line numbers plus the matched source snippet.

Use this to substantiate a suspected defect rather than guessing at it: the results are rule matches, so a hit is a fact. The snippet can be reused directly as existing_code when emitting a comment.

Scope paths to the file currently under review. OpenCodeReview only allows comments on the file being reviewed, so findings in other files cannot be reported even when the tool returns them.

An empty result is not a clean bill of health — it means no configured rule matched. The ruleset is broad but not exhaustive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYes
rulesetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

No annotations are present, so the description carries the burden. It discloses determinism, that results are factual rule matches, that an empty result means 'no configured rule matched' rather than clean code, and that the ruleset is nonexhaustive. It does not discuss performance, permissions, or failure behavior, but the most decision-relevant behavior is covered.

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?

Four tight sentences cover result, use case, path scoping, and interpretation caveat. There is no filler; each sentence adds actionable information.

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

Completeness4/5

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

With an output schema present, return values need no elaboration. The description covers when to use, how to scope paths, how to interpret empty results, and how to reuse the snippet. It would be slightly stronger with explicit guidance on the optional ruleset parameter and differentiation from semgrep_scan_diff, but nothing needed to perform a safe scan is missing.

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?

Schema description coverage is 0%, so the description must compensate. It adds real semantics for paths ('Scope paths to the file currently under review') and explains why other-file results are unusable. It gives only indirect context for the ruleset parameter ('The ruleset is broad but not exhaustive') without explaining acceptable values or how the default is treated.

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?

The opening sentence names a specific operation ('Run deterministic static analysis (Semgrep) over repository files') and a concrete result ('exact line numbers plus the matched source snippet'), so an agent knows what the tool does. It does not explicitly contrast with semgrep_scan_diff or semgrep_status, though 'over repository files' hints at full-repo scope.

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

Usage Guidelines4/5

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

It says when to reach for it: 'Use this to substantiate a suspected defect rather than guessing at it.' It gives a hard scoping rule ('Scope paths to the file currently under review') and explains why ('findings in other files cannot be reported'). It still doesn't name semgrep_scan_diff or semgrep_status as alternatives or state when not to use this tool, so it stops short of full routing.

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

Deploy Server

Other Tools