Skip to main content
Glama
Project Scope MCP Server

Project Scope MCP Server

validate_sql_query

Detect SQL injection in dynamically built queries before execution. Blocks UNION attacks, stacked queries, comment injection, blind SQLi, and encoding tricks in strict or advisory mode.

Instructions

Prevent SQL injection. Detects UNION attacks, stacked queries (DROP TABLE), comment injection (--), boolean/time-based blind SQLi, and encoding tricks. Validate all dynamically constructed SQL before execution.

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": {
      "query": "<query>"
    },
    "name": "validate_sql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoValidation mode (default: strict)
queryYesThe SQL query string to validate
sensitivityNoDetection sensitivity (default: medium)
allowedKeywordsNoSQL keywords to allow (e.g., ['SELECT', 'INSERT', 'UPDATE'])

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it never says what the tool returns (boolean, findings list, rewritten query?), whether it merely inspects or also executes the query, or how its own 'mode' and 'sensitivity' settings change blocking versus warning behavior.

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 short sentences, front-loaded with the threat model before the usage directive; the attack enumeration earns its space but is compressed into one dense list that reads slightly like marketing copy.

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?

With four parameters, two enums, no annotations, and no output schema, the definition should explain at least the validation outcome semantics and what 'advisory' mode produces; as written, an agent knows what is detected but not what comes back or what it should do with the result.

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 all four parameters are documented in the schema, so the baseline applies; the description adds no meaning about how 'strict' vs 'advisory' or 'high' vs 'medium' sensitivity alter outcomes, nor about allowedKeywords interacting with the detected patterns.

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 (validate/scan an SQL query) and enumerates the concrete attack classes it catches (UNION, stacked queries, comment injection, blind SQLi, encoding tricks), which clearly separates it from siblings like validate_file_path and validate_shell_input.

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?

'Validate all dynamically constructed SQL before execution' gives an implied when-to-use condition, but there is no explicit guidance on when not to use it, no mention of an alternative tool for sanitization/escaping, and no note on whether static or already-parameterized queries need it.

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