Skip to main content
Glama
Hamzah-Muhammad

SafeDataBaseMCP

run_query

Run a single read-only SELECT query and return the matching rows. Blocks writes, DDL, PRAGMA, comments, and stacked statements to keep database access safe.

Instructions

Run one read-only SELECT and return the rows.

Only a single SELECT is accepted. Anything else - a write, DDL, PRAGMA, ATTACH, a stacked statement, a comment - is rejected before it reaches the database, and the connection used here is opened read-only anyway.

Args: sql: A single SELECT statement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It reveals that the connection is opened read-only, that input is validated before reaching the database, and that non-SELECT statements are rejected. This is significant behavioral context that would otherwise be invisible to the agent and goes well beyond the input schema.

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?

The description is compact and front-loaded with the primary purpose, followed by necessary safety details, and ends with an Args section. Each sentence contributes either to scope, constraints, or parameter meaning, with no filler or redundant schema repetition.

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 one-parameter tool with an output schema available, the description covers the essential behavioral constraints and parameter meaning. It does not explicitly mention error behavior or how returned rows are structured, but the output schema likely handles the return shape. Minor gap: it could more directly say 'use this for read-only SQL exploration,' but the read-only emphasis already communicates that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema only defines sql as a required string with no description, so schema coverage is 0%. The description compensates partly by specifying 'A single SELECT statement,' which adds the essential constraint on the parameter. It could add more detail about whether semicolons are allowed or how to structure complex queries, but for a single parameter the provided semantics are adequate.

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?

The description opens with 'Run one read-only SELECT and return the rows,' a clear verb-resource pair that defines exactly what the tool does. It also distinguishes itself from siblings by restricting input to SELECT statements, while siblings like list_tables and describe_table serve different schema-introspection purposes.

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

Usage Guidelines4/5

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

The description clearly states that only a single SELECT is accepted and that writes, DDL, PRAGMA, ATTACH, stacked statements, and comments are rejected, which tells the agent when this tool is appropriate and what it is not for. It does not explicitly name alternative tools for write operations, but the sibling list and the rejection behavior make the boundary clear.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hamzah-Muhammad/SafeDataBaseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server