Skip to main content
Glama
kpconnell
by kpconnell

query_database

Execute read-only SQL queries against MariaDB/MySQL or Microsoft SQL Server databases using OAuth 2.0 authentication for secure data retrieval.

Instructions

Execute a read-only SQL query against one of the configured database connections. Pass connection with the name of the target (omit if only one connection exists — use list_connections to see the names and which engine each uses). Only read statements are allowed (SELECT/SHOW/DESCRIBE/EXPLAIN/WITH on MariaDB; SELECT/WITH and a small allowlist of sp_help / sp_columns / sp_tables procs on MSSQL). Results are capped at a configurable row limit (default 1000). Use list_schema first if you don't know the table structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNo
sqlYes
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it's read-only (only specific SQL statements allowed per database type), results are capped at a configurable row limit (default 1000), and it requires database connections. It doesn't mention error handling or performance limits, but covers essential safety and constraints.

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 appropriately sized and front-loaded, starting with the core purpose. Each sentence adds value: connection usage, SQL restrictions, result capping, and preparatory steps. There is no wasted text, making it efficient and easy to parse.

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?

Given the complexity (SQL query execution with safety constraints), no annotations, no output schema, and 2 parameters with 0% schema coverage, the description is largely complete. It covers purpose, usage, behavioral limits, and parameters. A minor gap is lack of output format details, but it's sufficient for an agent to use the tool correctly.

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?

Schema description coverage is 0%, so the description must compensate. It explains both parameters: `connection` (target name, omit if only one exists, use `list_connections` to see names) and `sql` (read-only statements, with examples per database type). This adds significant meaning beyond the bare schema, though it could detail SQL syntax more.

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 clearly states the verb ('execute') and resource ('SQL query against one of the configured database connections'), specifying it's read-only. It distinguishes from siblings by mentioning `list_connections` and `list_schema` as preparatory tools, showing differentiation in purpose.

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?

It provides explicit guidance on when to use this tool (for read-only SQL queries) and when to use alternatives (use `list_connections` to see connection names, use `list_schema` first if you don't know table structure). It also mentions prerequisites like omitting `connection` if only one exists.

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

Install Server

Other Tools

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/kpconnell/db-oauth-mcp-node'

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