Skip to main content
Glama

Odoo instance database sessions

hodiploy_list_postgres_sessions
Read-onlyIdempotent

The PostgreSQL sessions of an instance, live: for each, pid, application, client address, state (active, idle, "idle in transaction"), transaction age and idle time in seconds, wait event, blocked_by (pids it waits for), blocking (how many wait for it), waiting_for (e.g. "row (0,1) of ir_sequence"), holding (tables it holds locks on) and the start of its query; plus a summary and max_connections. Use it on lock errors ("could not obtain lock", "canceling statement due to lock timeout"), timeouts or a saturated database: sessions idle in a transaction that block others are usually the cause. Works even when the connections are exhausted.

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": {
      "instance_id": "<instance_id>"
    },
    "name": "hodiploy_list_postgres_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoSessions returned, oldest transaction first. The summary always counts them all.
service_idNoHodiploy service id from hodiploy_list_instances. Optional when the user has a single Hodiploy service.
instance_idYesInstance id from hodiploy_list_instances.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, so the description's value is the extra behavior it discloses: it works even when connections are exhausted, and it explains how blocked_by/blocking/holding map to lock chains. It does not discuss cost, rate limits, or ordering caveats beyond the limit semantics already in the schema.

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?

Purpose is front-loaded, then the field enumeration, then the diagnostic use cases. The long middle clause is dense but every listed field earns its place as return-value documentation; only minor tightening is possible.

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?

With no output schema, the description carries the full burden of explaining the return payload, and it does: per-session fields, lock relationships, the summary, and max_connections. Combined with the lock-diagnosis guidance, an agent has everything needed to call and interpret it.

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%, so all three parameters (instance_id, service_id, limit) are already documented in the schema, including that limit is ordered oldest-transaction-first and that the summary always counts all sessions. The description adds no parameter-level meaning beyond that, which is the baseline-3 case.

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 opening clause names a concrete resource (live PostgreSQL sessions of one instance) and enumerates the returned fields, which clearly separates it from aggregate/config siblings such as get_database_health and get_postgres_config. The verb 'list/retrieve' is only implied, and no sibling is named explicitly, so it stops short of a 5.

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?

It gives concrete triggers — lock errors like 'could not obtain lock' or 'canceling statement due to lock timeout', timeouts, a saturated database — plus the diagnostic heuristic (sessions idle in a transaction that block others). There are no explicit when-not conditions or named alternative tools, so it is strong context without exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources