Skip to main content
Glama

Explain Database Query

unfour.db.explain
Read-onlyIdempotent

Run EXPLAIN on a saved database connection for read queries, returning structured execution details and duration. Use before optimizing slow SELECT or WITH queries to spot performance problems.

Instructions

Runs EXPLAIN for a read query against a saved database connection through the Unfour command bus. Use before optimizing slow SELECT/WITH queries. This is read-only in dev/test/prod; it returns structured columns/rows, durationMs, and truncation metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
schemaNo
catalogNo
timeoutMsNo
workspaceIdNo
connectionIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
sqlYes
rowsNo
sourceYes
columnsNo
rowCountNo
truncatedNo
durationMsNo
connectionIdYes

Schema Changelog

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

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

The description states it is read-only in dev/test/prod and returns structured columns/rows, durationMs, and truncation metadata, which adds valuable behavioral context beyond the annotations. There is no contradiction with the annotations (readOnlyHint, idempotentHint, destructiveHint all align). The description also implies non-destructiveness and clarifies expected outputs, though it could mention that it does not execute the query for side effects or that it requires an existing connection.

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 concise, at two sentences, and front-loads the action and use case. Every phrase adds value: the command bus, read-only guarantee, use-before-optimization guidance, and return value highlights. No filler or repetition of schema details.

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 tool's moderate complexity (7 params, but only 2 required) and the presence of an output schema (which explains return values), the description provides sufficient context for selection and core usage. It covers the purpose, use case, safety profile, and return format highlights. The main gap is the lack of parameter semantics, but the required parameters (connectionId, sql) are intuitive from the description, and the output schema handles return structure.

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 0%, so the description must compensate for the seven parameters. It mentions 'saved database connection' and 'read query', but does not explain parameters like limit, schema, catalog, timeoutMs, workspaceId, or connectionId. The description adds minimal semantic detail beyond the schema; it indicates connectionId and sql are key but does not explain their roles or optionality, so the agent may struggle with how to set these parameters for optimal use.

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 tool runs EXPLAIN for a read query against a saved database connection, which is a specific verb+resource combination. It distinguishes itself from siblings like unfour.db.query_readonly and unfour.db.execute by focusing on query optimization via EXPLAIN, making its purpose unambiguous.

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 explicitly says to use it 'before optimizing slow SELECT/WITH queries', giving a clear use case. However, it does not explicitly mention when NOT to use it or name alternative tools for other scenarios, such as unfour.db.query_readonly for actual data retrieval, though the context implies it.

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/zyqzyq/Unfour'

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