Skip to main content
Glama

Scan a single code snippet

scan_snippet
Read-only

Execute static security checks on an in-memory code string to identify vulnerabilities in AI-generated Supabase or Next.js code before sharing or committing.

Instructions

Runs the static engine on one in-memory string as if it were a file. Use this after generating code, before showing it to the user or committing it. Cheaper than scan_path when only a diff is at stake.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path this snippet would live at, e.g. src/api/orders.ts. Used to make client-side heuristics work (files under public/, src/components/, *.tsx, etc. are treated as shipped to the browser).
contentYesThe full source text of the file/snippet.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description adds useful behavioral context beyond that: it operates on an in-memory string, simulates file-based scanning, and is cheaper than a full path scan. It does not describe the return shape, but the read-only, in-memory behavior is clearly conveyed.

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 with no filler: the first states the core behavior, the second gives the intended use case and cost comparison. All information is front-loaded and useful.

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?

For a two-parameter, read-only tool with thorough schema descriptions, the description covers purpose, usage timing, and trade-offs versus scan_path. The only minor gap is that it never explicitly says what the scan returns, but the 'scan' semantics and sibling explain_finding make the outcome reasonably inferable.

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%, with detailed descriptions for both path and content, including why path matters for client-side heuristics. The description itself adds little parameter-level meaning beyond 'one in-memory string,' so it meets the baseline but does not exceed what the schema already provides.

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: 'Runs the static engine on one in-memory string as if it were a file.' It clearly distinguishes itself from the sibling scan_path by operating on an in-memory string rather than a filesystem path.

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

Usage Guidelines5/5

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

Gives explicit usage context: 'Use this after generating code, before showing it to the user or committing it.' It also names the alternative (scan_path) and the selection condition ('Cheaper than scan_path when only a diff is at stake'), so an agent knows when to pick this tool.

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