Skip to main content
Glama

list_activity

View current PostgreSQL sessions and per-state counts, flagging idle-in-transaction backends that hold resources.

Instructions

[READ] Current sessions (pg_stat_activity) with per-state counts.

Flags idle-in-transaction backends (open transactions holding resources).

Args:
    state: Optional exact state filter (active, idle, 'idle in transaction').
    include_idle: Include plain idle backends (default True).
    target: Target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNo
targetNo
include_idleNo
Behavior4/5

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

With no annotations, the description carries full burden. It indicates the operation is read-only via the '[READ]' prefix and describes behavior like counting sessions and flagging idle-in-transaction. This is transparent, though it could mention permission requirements or limitations.

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, with a one-line summary followed by bullet-pointed arguments. Every sentence adds value, and the structure is easy to parse.

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?

The description covers the tool's purpose, behavior (per-state counts, idle-in-transaction flagging), and all arguments. It does not explicitly describe the return format, but for a list tool this is acceptable. Overall, it is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema. For 'state' it specifies 'optional exact state filter', for 'include_idle' it explains 'include plain idle backends (default True)', and for 'target' it clarifies it's a target from config. Since schema coverage is 0%, the description compensates fully.

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 it is a read operation that lists current sessions (pg_stat_activity) with per-state counts and flags idle-in-transaction backends. This distinguishes it from sibling tools like 'list_extensions' or 'long_running_queries'.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use this tool vs alternatives. Some context is implied (e.g., for viewing sessions), but no exclusions or comparisons are provided, leaving the agent to infer usage from the purpose.

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/AIops-tools/Postgres-AIops'

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