Skip to main content
Glama

scan_code

Reviews code snippets with regex heuristics to flag common security risks like secrets, injection, weak crypto, TLS issues, XSS, SSRF, and unsafe deserialization. Complements SAST; not a replacement.

Instructions

Fast regex review of a snippet for common vulnerability patterns (secrets, injection, weak crypto, TLS off, XSS sinks, JWT bypass, SSRF, unsafe deserialization, unpinned CI refs). Heuristic: false positives and misses expected; complements SAST, never replaces it.

Input Schema

NameRequiredDescriptionDefault
codeYes
filenameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the mechanism (regex, hence no semantic understanding), the accuracy profile ('false positives and misses expected'), and the speed trade-off ('Fast'). It omits operational details such as output shape, severity scoring, or the 200k character input cap, which is why it isn't 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.

Conciseness5/5

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

Two tight sentences: capability first, then the honest limitation caveat. Every clause earns its place — the vulnerability list and the heuristic disclaimer are both load-bearing.

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 tool with no annotations and no output schema, the description explains what it detects and how much to trust it, but leaves two gaps: it never explains what a scan returns (finding list, severity, line refs?) and never documents its two parameters, one of which is 0%-covered by the schema.

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?

Schema description coverage is 0% and the description never mentions either parameter. 'Snippet' loosely implies the required `code` argument, but `filename` and the 200,000-character maxLength constraint are completely undocumented in both schema and description, so an agent gets no guidance on what `filename` changes (language detection? path-based context?).

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 ('fast regex review of a snippet') and enumerates the vulnerability classes it targets, which makes its purpose unmistakable. The word 'snippet' implicitly separates it from the path-based sibling scan_path, but it never names that sibling explicitly, so the differentiation is inferred rather than stated.

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?

Gives clear contextual guidance: it 'complements SAST, never replaces it', which tells the agent this is a supplementary heuristic pass rather than an authoritative audit. It stops short of explicit routing rules — nothing says when to prefer scan_path, secure_coding_checklist, or search_security over this tool.

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