Skip to main content
Glama
sparta2025

Postgres MCP Pro

by sparta2025

get_active_queries

Identify currently running PostgreSQL queries and their durations to detect long-running or blocked sessions, helping troubleshoot performance issues.

Instructions

List currently running queries and their duration.

Args:
    database_url: Database URL (optional, uses DATABASE_URL from .env if omitted).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_urlNo

Schema Changelog

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

  1. First observedv0.4.2

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are present, so the description carries the behavioral disclosure burden. It does clarify that database_url is optional and falls back to DATABASE_URL from .env, and it states the kind of output. However, it does not mention potential permission requirements, whether the list is scoped to the current database/user, or any performance implications.

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 extremely concise: one sentence for the core purpose and a brief parameter note. There is no filler or redundancy, and the main action is front-loaded.

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 simple one-parameter tool, the description gives enough to invoke it correctly: what it does, what it returns, and how to provide the connection. However, with no annotations or output schema, it leaves minor ambiguity about the exact fields returned and any access prerequisites.

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 schema only provides the parameter name, nullability, and default null. The description adds meaningful context by stating the parameter is optional and that omitting it uses DATABASE_URL from .env. This compensates well for the 0% schema description coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') on a well-defined resource ('currently running queries') and includes the output attribute 'duration'. It is implicitly distinguishable from siblings like get_top_queries, which suggests historical or aggregated query data, though it does not explicitly name any alternatives.

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

Usage Guidelines2/5

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

There is no guidance about when to use this tool versus alternatives such as get_top_queries, get_database_locks, or analyze_db_health. The description states only what the tool does, not the conditions that make it the right choice.

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/sparta2025/postgres-mcp'

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