Skip to main content
Glama

long_running_queries

Read-only

Identify active PostgreSQL queries running at least a minimum number of seconds, oldest first, to diagnose slow-query performance and blocking issues.

Instructions

[READ] Active queries running at least min_seconds, oldest first.

Args:
    min_seconds: Minimum age in seconds (default 60).
    target: Target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNo
min_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

The readOnlyHint annotation already declares this a safe read. The description adds the ordering behavior (oldest first) and the notion of 'active' queries, but says nothing about pagination, result size limits, or whether terminated/finished queries are excluded. With annotations covering the safety profile, this is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a [READ] tag and a single-sentence summary before the Args block, so the essential scope is visible immediately. The Args formatting is slightly verbose but each line earns its place.

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?

With no output schema, no required params, and a simple read, the description covers both parameters and the core behavior sufficiently. Only the exclusion of sibling tools and any return-shape hints are missing, which are minor for this complexity level.

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 coverage is 0%, so the description must carry the param burden, and it does: min_seconds is defined as minimum age in seconds with default 60, and target is explained as a config target name with an omit-for-default rule. Both parameters gain meaning the bare schema lacks.

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?

States a specific resource (active queries), a threshold scope (running at least min_seconds), and an ordering (oldest first), which is more than a tautology. It does not, however, differentiate itself from siblings like top_queries, slow_query_rca, or list_activity, so an agent must still infer the boundary between them.

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 when-to-use guidance and no named alternatives despite a crowded sibling set (top_queries, slow_query_rca, list_locks, list_activity). The description never says when this tool is preferable to those, leaving selection entirely to inference.

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