Skip to main content
Glama

Read the audit log

pg_audit_log
Read-onlyIdempotent

Review recent PostgreSQL audit log entries to see which tool ran, on which connection, the SQL, the outcome, and the rule that refused it.

Instructions

Show the most recent entries of pgharbor's audit log: which tool ran, on which connection, the SQL, the outcome and the rule that refused it.

Useful to review what was executed in this and previous sessions.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "pg_audit_log"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
outcomeNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is fully covered. The description adds real value beyond that by disclosing the shape of a log entry and that entries persist across sessions. It omits the default page size (limit 30) and ordering guarantees, so it is not complete on behavior an agent would care about.

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?

Two short sentences with the core purpose front-loaded, followed by a use-case line. No filler, though the second sentence is thin enough that it could have carried filter or paging guidance instead.

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

Completeness3/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 correctly spends its words explaining what an entry contains, which is the right call. But for a 3-parameter filtered read tool with zero schema coverage it should also explain the filters and default limit, leaving an agent unsure how to narrow results.

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

Parameters2/5

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

Schema description coverage is 0% and all three parameters (limit, outcome, connection) are bare typed fields with no descriptions. The description mentions connection and outcome only as fields of a log entry, not as the filters they actually are, and never mentions limit or the enum values (ok/refused/error/needs-approval/approved/bug), so it does not compensate for the coverage gap.

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?

Names a specific verb and resource ("Show the most recent entries of pgharbor's audit log") and enumerates the record contents an agent will get back (tool, connection, SQL, outcome, refusing rule). It does not distinguish itself from the similarly-scoped pg_security_audit sibling, so an agent must infer the boundary.

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?

"Useful to review what was executed in this and previous sessions" implies a retrospective-review use case and adds a temporal scope hint. However there is no explicit when-to-use rule, no when-not, and no pointer to pg_security_audit or pg_activity as alternatives, which is the main ambiguity for a log-reading tool.

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