Skip to main content
Glama

scan_code

Run rule detectors over code snippets to flag secrets, injection patterns, and unsafe idioms, providing heuristic hints before security-sensitive code is finalized.

Instructions

Run rule detectors (secrets, injection patterns, unsafe idioms) over a snippet. Heuristic hints, not proof. Call when: you wrote security-sensitive code and are about to call it done.

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": {
      "text": "<text>"
    },
    "name": "scan_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
languageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the most important trait — results are 'heuristic hints, not proof' — which warns of false positives. It says nothing about whether the scan is read-only, its cost/latency, or what the result contains, so meaningful gaps remain.

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?

Three short clauses, front-loaded with the action and detector scope, followed by the caveat and the trigger. Nothing is padded or repeated.

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?

There is no output schema, so the description should ideally convey what comes back (findings list, severity, per-rule hits) and what `language` does. The 'heuristic hints' caveat covers expectation-setting, but the return shape and second parameter are left undocumented.

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%, so the description must compensate for both parameters. 'Over a snippet' weakly implies the required `text` argument, but the optional `language` parameter is never mentioned and no format or accepted values are given for either.

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 plus resource ('Run rule detectors') and enumerates detector families (secrets, injection patterns, unsafe idioms) over 'a snippet', which implicitly separates it from project-wide siblings like audit_project. It stops short of naming an alternative, but the scope (snippet) is clear.

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?

Provides an explicit trigger: 'Call when: you wrote security-sensitive code and are about to call it done.' That tells the agent both the condition and the timing. No explicit exclusion or named alternative, so it falls short of a 5.

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