Skip to main content
Glama

scan_code

Scan Python and JavaScript/TypeScript source code with AST analysis to detect injection, SSRF, key exfiltration and other vulnerabilities before execution; returns severity counts.

Instructions

Scan source code for security vulnerabilities using deterministic AST analysis. Detects 57 vulnerability patterns across Python (28 rules) and JavaScript/TypeScript/TSX (29 rules), including code injection, wallet key exfiltration, SSRF, SQLi, prototype pollution, and ReDoS. Unpaid calls return a live Threat Diagnostic Preview with vulnerability count & severity.

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

Input Schema

NameRequiredDescriptionDefault
languageNoProgramming language of the source codepython
payment_txNoSolana signature or Base 0x transaction hash for x402 payment (0.0007 SOL or 0.10 Base USDC)
source_codeYesThe source code to scan for security vulnerabilities (max 100KB)
session_tokenNoPrepaid ScanPay session voucher token (sp_sess_...) for 0ms RPC bypass

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.8/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden; it discloses meaningful behavior by explaining that unpaid calls return a live Threat Diagnostic Preview with vulnerability count and severity rather than failing, and that analysis is deterministic AST-based. It omits what a paid call returns in full, what happens on invalid payment, and any rate limits, leaving some gaps.

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?

Three sentences, front-loaded with purpose, then coverage, then the unpaid-call behavior. The phrasing 'live Threat Diagnostic Preview' carries mild marketing tone, but no sentence is redundant.

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 four-parameter tool with no output schema, the description should say what a successful scan returns. It covers only the unpaid preview and never describes the paid result structure, so an agent knows how to trigger the tool but not what it will receive on payment.

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%, so all four parameters including language enum, payment_tx, and session_token are already documented. The description corroborates the language scope (Python 28 rules, JS/TS/TSX 29 rules) but adds no syntax, format, or precedence detail beyond the schema.

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

Purpose5/5

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

States a specific verb and resource ('Scan source code for security vulnerabilities') plus the mechanism ('deterministic AST analysis'), and names the rule counts and vulnerability classes. An agent can distinguish this from siblings like audit_token or simulate_tx without opening the schema.

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?

Usage is implied by the description's framing of a paid scan with an unpaid preview, but there is no explicit when-to-use guidance, no statement of when not to use it, and no comparison to the sibling tools such as audit_token. The agent must infer the context from the payment language.

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