Skip to main content
Glama
Dmitriusan

mcp-db-analyzer

by Dmitriusan

analyze_slow_queries

Identifies and analyzes slow database queries, showing execution times and optimization recommendations. Works with PostgreSQL and MySQL.

Instructions

Find the slowest queries using pg_stat_statements (PostgreSQL) or performance_schema (MySQL). Shows execution times, call counts, and optimization recommendations. PostgreSQL requires the pg_stat_statements extension to be installed and listed in shared_preload_libraries — the tool returns setup instructions if the extension is missing. Not available for SQLite.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoDatabase schema (default: public)public
limitNoNumber of slow queries to return (default: 10)
timeout_msNoConnection timeout in milliseconds (default: 30000). Increase for slow or remote databases.
Behavior4/5

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

Discloses reliance on specific system views, graceful handling of missing extension (returns setup instructions), and output contents. With no annotations, description covers key behavioral aspects adequately.

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?

Three sentences, under 60 words, front-loaded with purpose. Every sentence adds value; no redundancy.

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?

Covers purpose, database requirements, and high-level outputs. Lacks explicit mention of return format or pagination, but acceptable for a diagnostic tool with simple parameters.

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?

All three parameters are fully described in the input schema (100% coverage). Description adds no extra meaning beyond schema defaults and descriptions, so baseline of 3 is appropriate.

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?

Clearly states it finds slow queries using specific database extensions, shows execution times, counts, and recommendations. Distinct from sibling tools like analyze_indexes or explain_query.

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?

Provides clear context: available for PostgreSQL and MySQL, not for SQLite; PostgreSQL requires pg_stat_statements extension. Does not explicitly mention alternatives but siblings are listed.

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/Dmitriusan/mcp-db-analyzer'

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