Skip to main content
Glama
isdaniel

PostgreSQL-Performance-Tuner-Mcp

get_active_queries

Read-onlyIdempotent

Monitor active PostgreSQL queries to identify long-running operations, detect lock contention, and analyze query patterns for performance optimization.

Instructions

Get information about currently active queries and connections.

Note: By default, this tool excludes system/background processes and focuses on client backend queries to help you analyze your application's query patterns. System catalog queries are filtered out unless explicitly requested.

Shows:

  • All active queries and their duration

  • Idle transactions that may be holding locks

  • Blocked queries waiting for locks

  • Connection state breakdown

Useful for:

  • Identifying long-running queries

  • Finding queries that might need optimization

  • Detecting stuck transactions

  • Troubleshooting lock contention

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_duration_secondsNoMinimum query duration in seconds to include
include_idleNoInclude idle connections
include_systemNoInclude system/background processes
databaseNoFilter by specific database
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds valuable behavioral context beyond annotations: it explains default filtering behavior (excludes system/background processes), specifies what types of queries are shown (active queries, idle transactions, blocked queries, connection states), and mentions the tool's analytical purpose for optimization and troubleshooting. No contradiction with annotations exists.

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 well-structured and front-loaded: the first sentence states the core purpose, followed by a 'Note:' section for important clarifications, a 'Shows:' bullet list for output details, and a 'Useful for:' section for usage context. Every sentence adds value without redundancy, and the bullet points enhance readability.

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 (4 parameters, no output schema), the description is largely complete. It explains the tool's purpose, usage guidelines, behavioral traits, and output scope. However, without an output schema, it doesn't detail the exact structure of returned data (e.g., fields, formats), which is a minor gap. The annotations provide safety context, and the description compensates well for the lack of output schema with the 'Shows:' section.

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 100%, with all 4 parameters well-documented in the schema itself. The description doesn't add significant parameter semantics beyond what's in the schema, though it implies the tool's default behavior aligns with parameter defaults (e.g., excluding system processes unless include_system=true). This meets the baseline of 3 for high schema coverage.

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's purpose: 'Get information about currently active queries and connections.' It specifies the resource (active queries and connections) and distinguishes from siblings like 'get_slow_queries' by focusing on currently running queries rather than historical slow ones. The 'Shows:' section further elaborates on what information is retrieved.

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?

The description provides explicit guidance on when to use this tool: 'Useful for: Identifying long-running queries, Finding queries that might need optimization, Detecting stuck transactions, Troubleshooting lock contention.' It also distinguishes from siblings by noting this tool focuses on active queries while tools like 'get_slow_queries' likely focus on historical performance. The 'Note:' section clarifies default exclusions (system processes) and when to include them.

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/isdaniel/pgtuner-mcp'

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