Skip to main content
Glama
db-conn-mcp

db-conn-mcp

show_activity

Read-onlyIdempotent

Inspect sanitized database server activity (PID, state, wait events, query/transaction age) to identify what holds connections; optionally include query text.

Instructions

Show current server activity: pid, state, wait events, query/transaction age.

Sanitized by default — no user names, client addresses, or query text (pass include_query=true for query text cut to 300 characters). Answers "what is holding connections"; pair with cancel_query(pid) to kill a stuck statement.

Returns meta, database and activity, one item per server backend.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>"
    },
    "name": "show_activity"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseYesName of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names.
include_queryNoAlso return each backend's query text, cut to 300 characters. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.1
    • addedInput schema / properties / database / description
      Added value: +"Name of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names."
    • addedInput schema / properties / include_query / description
      Added value: +"Also return each backend's query text, cut to 300 characters. Default false."
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so the safety profile is covered upstream. The description still adds real value beyond them: output is sanitized by default (no user names, client addresses, or query text) and query text is truncated to 300 characters when requested. It does not mention pagination or whether every backend on the server is listed versus only the connected database.

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?

Three short, front-loaded sentences: purpose first, then safety/privacy caveat, then return shape. The 300-character truncation detail appears in both the first and second sentence, a small redundancy in an otherwise tight definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates by naming the return envelope (meta, database, activity) and the item granularity (one per server backend). With only one required, fully documented parameter and annotations covering safety, an agent has everything needed to call this correctly.

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 coverage is 100% and the database parameter is already documented as case-sensitive, list_databases-exact, and an error-listing unknown name, so the schema does the heavy lifting. The description restates the include_query behavior (query text cut to 300 characters) rather than adding new semantics; it only adds the rationale that the default view is deliberately sanitized. Baseline 3 applies.

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?

Opens with a specific verb and resource ("Show current server activity") and immediately enumerates the fields returned: pid, state, wait events, query/transaction age. That is enough to distinguish it from stats-oriented siblings such as table_stats or check_database without opening a schema.

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?

Gives a concrete diagnostic question it answers ("what is holding connections") and an explicit follow-up workflow with cancel_query(pid) for killing a stuck statement. It stops short of stating when not to use it — e.g. no pointer to a history/locking sibling — but the positive guidance is clear.

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