Skip to main content
Glama
kenningai

Kenning PG MCP

by kenningai

execute_query

Run a read-only SQL query with parameter placeholders, returning columns, rows, row count, and a truncation notice if limits are hit. For potentially expensive queries, run explain_query first.

Instructions

Run a single read-only SQL statement inside a READ ONLY transaction and return {columns, rows, row_count, truncated, notice?}. Exactly one statement per call. Use %s placeholders with the params list for user-supplied values. Results are capped at the configured row and byte limits with an explicit truncation notice when more data exists — no LIMIT is ever injected into your SQL. Cost depends entirely on the query; run explain_query first for anything potentially expensive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behaviors: read-only nature, single-statement enforcement, result capping with truncation notices, no injected LIMIT, and cost dependency on the query. It doesn't mention permission requirements or what happens on SQL errors, but covers the significant behavioral traits well.

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?

Compact multi-line description with zero wasted words. Front-loaded with the core action, then the return contract, then params usage, then the truncation/cost caveats. Every sentence earns its place — no filler or repetition of schema fields.

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?

For a tool with an output schema present and several behavioral nuances, the description is thorough. It covers the single-statement constraint, placeholder usage, truncation semantics, and cost guidance. It's slightly shy of complete — could mention error handling and permissions — but given the complexity and the presence of an output schema, this is well covered.

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% and there are 2 params with an empty schema (sql and params have no descriptions). The description compensates well: it explains the %s placeholder mechanism for params and the placeholder-binding pattern. It doesn't detail param type constraints beyond 'user-supplied values', but adds meaningful semantics to an otherwise bare schema.

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?

Description states a specific verb+resource: 'Run a single read-only SQL statement' and explicitly frames it as READ ONLY within a transaction. It specifies the return shape ({columns, rows, row_count, truncated, notice?}) and distinguishes itself by requiring 'Exactly one statement per call' — differentiating from siblings like describe_object and list_objects.

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?

Description gives strong usage context: how to use %s placeholders with params, that results are capped with truncation notice, and that no LIMIT is injected. It explicitly says to 'run explain_query first for anything potentially expensive', which advises on when to use a sibling tool. It could add explicit when-not-to-use conditions but the guidance is substantive.

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/kenningai/kenning-pg-mcp'

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