Skip to main content
Glama

AI Code Security Gate

Scan Code

scan_code

Scan one code file before writing, committing, or merging it.

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

Input Schema

NameRequiredDescriptionDefault
pathYesFile path, e.g. "app.py" — used to pick language-aware rules.
api_keyNoYour paid API key (required — or send it as an X-API-Key header, or set GATE_API_KEY once). Without a key no scan runs. With a key, each scan costs $0.05 after your first 20 free scans; out of credit returns payment instructions (USDC on Base) instead of a scan.
contentYesThe full file content to scan.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare openWorldHint=false, destructiveHint=false and readOnlyHint=false; the description adds workflow context (a pre-write gate) but nothing about what happens when findings are returned, whether a failed scan blocks the write, or whether results are cached/side-effect-free. The paid-scan and API-key behavior lives entirely in the schema, not the description.

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?

A single eleven-word sentence with the action and the timing constraint front-loaded. Nothing in it is redundant or padding.

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?

An output schema exists, so return values need not be described, and cost/auth are covered by the schema. However, for a gating tool with a similarly named sibling and paid-per-call semantics, the description omits what to do with findings (fix and rescan?) and when shadow_scan is the appropriate alternative.

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 100%, and the schema already explains path's language-rule purpose, content, and the API key/pricing model in detail. The description adds no parameter meaning beyond the schema, so the baseline 3 applies.

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?

Uses a specific verb and resource ("scan one code file") plus a clear scope limit of a single file. It does not differentiate itself from the similarly named sibling shadow_scan or explain how the two differ, so it falls short of the 5 bar.

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 an explicit trigger condition — before writing, committing, or merging — which tells the agent exactly where in a workflow this belongs. It offers no exclusions or named alternatives (e.g. when a shadow/pre-flight scan would suffice), so it stops short of explicit when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.