Skip to main content
Glama
jaynasriwala

Universal Database MCP

by jaynasriwala

execute_safe_query

Validate and run read-only SELECT queries while enforcing role-based access, tenant filtering, and sensitive-data masking before returning results.

Instructions

Validate and run a read-only SELECT statement. Applies RBAC, tenant row-level filtering, and sensitive-data masking before returning results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleNoOne of "admin", "analyst", "support", "readonly_guest". Ignored (and taken from your access token instead) if the server is running with authentication enabled.
db_uriNoA short connection name configured on the server (e.g. "prod"), a full connection string for local testing, or empty ("") to use the server's default database.
sql_queryNoA single SELECT statement. Anything else is rejected.
tenant_idNoRequired if the role needs row-level filtering. Also taken from your access token when auth is enabled.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does so well: it discloses that only a single SELECT is accepted, and that RBAC, tenant row-level filtering, and sensitive-data masking are applied before results return. It omits error behavior on rejection and any rate limits, so it is not complete.

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 tightly written sentences with zero waste; the action is front-loaded and the security pipeline follows in one compact clause. Every phrase earns its place.

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?

An output schema exists, so return values need not be explained, and the description plus a fully documented schema cover the call mechanics. The remaining gap is behavioral edge cases (rejection/error surface, tenant_id requirement conditions) that the schema covers only partially.

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 coverage is 100%, so the schema already documents all four parameters, including role, db_uri, sql_query, and tenant_id semantics. The description adds nothing parameter-specific beyond the general mention of RBAC and tenant filtering, 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?

States a specific verb ('Validate and run') and resource ('read-only SELECT statement'), so the agent knows this executes SQL rather than explaining or exporting it. It does not name or contrast with siblings like explain_sql_query, so it falls short of a 5.

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?

The description implies the tool's context (running read-only SELECTs) but gives no explicit when-to-use guidance against explain_sql_query or get_database_schema, and no stated prerequisites or exclusions. Usage must be inferred from the sibling names.

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