Skip to main content
Glama
AkshaySwami14

pg-schema-scout

describe_table

Read-onlyIdempotent

Fetch full table schema details by name, listing columns, types, primary key, and foreign keys to discover related tables in PostgreSQL.

Instructions

Return full detail for one table by name.

Use this when you already know the table name: either search_schema returned it and you need the complete column list, or search_schema did not return it and you believe it exists anyway. This does not use the ranking, so it is the reliable way to reach a table that retrieval scored poorly.

Accepts either a qualified name ("sales.salesorderheader") or a bare one ("salesorderheader"). Returns columns with types and comments, the primary key, foreign keys out, and the foreign keys pointing in, which is how you find the tables that join to this one.

On failure:

  • "No table named ..." means it does not exist under that name. The error lists close matches; try one of those. Do not retry the same name, and do not guess a third spelling. Fall back to search_schema with a description of what the table should contain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ddlYes
nameYes
columnsYes
commentNo
primary_keyNo
schema_nameYes
foreign_keysNoEdges from this table to others.
row_estimateNo
referenced_byNoEdges from other tables into this one.
qualified_nameYes
Behavior5/5

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

Annotations already declare readOnly, idempotent, and non-destructive, but the description adds valuable behavioral details: accepted name formats (qualified vs bare), return contents (columns, types, comments, PK, FKs), and failure semantics with close-match suggestions and explicit 'do not retry/guess' instructions.

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?

The description is front-loaded with the core purpose, then organized into usage context, accepted inputs, return values, and failure handling. Every sentence adds operational value and there is no redundancy or filler.

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?

Considering the tool's moderate complexity and the presence of an output schema, the description is complete: it covers when to use, input formats, what the output contains (including how to find joining tables), and exact failure recovery steps. The sibling context (search_schema) is also directly addressed.

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

Parameters5/5

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

The schema only says 'name' is a required string (0% coverage), so the description fully compensates by explaining that the parameter accepts qualified or bare names, provides concrete examples, and clarifies the failure-response behavior associated with the name.

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?

The description opens with a specific verb and resource: 'Return full detail for one table by name.' It explicitly distinguishes itself from search_schema by noting it does not use ranking, making it the reliable way to reach a table with poor retrieval scores.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use scenarios: when the table name is already known from search_schema or when the table is believed to exist despite search_schema not returning it. It also provides fallback guidance on failure, telling the agent to try close matches and then fall back to search_schema with a description.

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/AkshaySwami14/pg-schema-scout'

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