Skip to main content
Glama

analyze_query

Read-onlyIdempotent

Analyzes PostgreSQL SQL offline for risky patterns and index suggestions without executing queries. Note: absence of findings doesn't prove safety.

Instructions

Offline PostgreSQL SQL heuristics. No execution; no finding is not proof of safety.

Input Schema

NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds real behavioral context beyond them: this is offline static analysis requiring no DB execution, and it explicitly warns about false negatives ('no finding is not proof of safety'). It does not disclose the specific checks performed or the return shape.

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?

Two terse sentences, front-loaded with the core capability and immediately followed by the most important caveat. Zero filler, though the extreme brevity edges toward under-specification rather than ideal concision.

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 one-parameter analyzer with annotations carrying the safety profile and no output schema, the description conveys the key operational fact (offline, no execution) and a critical caveat. It remains incomplete on what heuristics are run and what the result contains, which an agent would want before invoking.

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% and the description says nothing about the single required 'sql' parameter (format, size limits, dialect expectations). With a low-coverage schema the description is expected to compensate and it does not.

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

Purpose3/5

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

The description identifies the resource (PostgreSQL SQL) and the general action (heuristic analysis), and 'offline ... no execution' begins to separate it from an execution-based sibling like explain_plan. However, 'heuristics' is vague about what is actually being checked (performance, safety, style), so the agent cannot fully tell what this tool returns.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance and no sibling is named. 'No execution' implicitly contrasts with explain_plan and the caveat 'no finding is not proof of safety' is a limitation note, not routing guidance, so the agent must infer when to pick this over suggest_indexes or explain_plan.

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