Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Get compact schema

get_compact_schema
Read-only

Summarize a PostgreSQL schema's tables, columns, keys, nullability, and relations into a condensed text format to save context-window tokens; set fresh=true to bypass cache after schema changes.

Instructions

Return a highly condensed, token-efficient text summary of a schema's tables, columns, primary keys, nullability, and relations to save context window tokens. Set fresh=true to bypass the cache and re-read live (e.g. after a schema change).

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": {
      "schema": "<schema>"
    },
    "name": "get_compact_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
freshNo
schemaYes
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. Changed1 schema field changed
    • addedInput schema / properties / fresh
      Added value: +{
      +  "default": false,
      +  "title": "Fresh",
      +  "type": "boolean"
      +}
  3. First observedv0.6.8

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnly and closed-world, so the description's main added value is the caching behavior and the bypass path via fresh=true, which is genuinely useful operational context. It doesn't say whether the cache is shared across sessions or how large the output can get, but an output schema is present to carry return shape.

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 sentences, front-loaded with the purpose and followed by the one non-obvious parameter behavior. 'Highly condensed, token-efficient' is mildly redundant but reinforces the tool's differentiator rather than padding.

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 read-only, three-parameter summarization tool with an output schema, the description covers what matters: what is summarized, why (token savings), and how to force a live read. Missing only explicit sibling routing and any mention of scope limits, such as single vs. multiple schemas.

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 only 33% (only `database` is described in the schema). The description explains `fresh` well, including its purpose and an example trigger, but leaves the required `schema` parameter uncharacterized and doesn't reinforce the primary-vs-secondary database distinction. Partial compensation for a real 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?

States a specific verb and resource: returns a condensed text summary of a schema's tables, columns, primary keys, nullability, and relations, with the explicit goal of saving context tokens. It doesn't name any of the many sibling tools it competes with (describe_table, list_tables, generate_schema_docs), so the differentiation is only implicit.

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 only usage guidance is conditional and tied to a parameter: use fresh=true after a schema change. There is no explicit statement of when an agent should pick this over describe_table, list_tables, or generate_schema_docs, which are all plausibly overlapping choices in this catalog.

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

Deploy Server

Other Tools