Skip to main content
Glama

Table Information

db_table_info
Read-onlyIdempotent

Get detailed information about a specific table, including exact row count, columns, indexes, foreign keys, and size. Use to drill down after an overview or before writing performance-sensitive queries.

Instructions

Returns detailed information about a single table: exact row count (via COUNT(*)), all columns with their types and nullability, all indexes with their columns and uniqueness, foreign key relationships, and approximate table size on disk. Use this when you need specifics about one table that go beyond the overview.

When to use:

  • After db_overview, to drill into a specific table's details.

  • When the user asks "Tell me about the orders table" or "What indexes does users have?"

  • Before writing performance-sensitive queries, to understand available indexes.

  • When debugging issues related to a specific table.

Behavioral notes:

  • Row count is exact (uses COUNT(*)), which may be slow on very large tables.

  • The table name must exist in the database — a typo returns a clear error with suggestions from the schema.

  • Table size is approximate, based on pg_table_size().

Returns: JSON with row_count, columns array, indexes array, foreign_keys, and size_bytes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesName of the table to query
databaseNoName of the database to query (from pgautopilot.json). Omit to use the current default database.
Install Server

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already indicate read-only, idempotent, and non-destructive behavior, and the description adds meaningful behavioral details beyond that: exact row count via COUNT(*) may be slow on large tables, typos produce clear errors with schema suggestions, and table size is approximate via pg_table_size(). This is exactly the kind of context an agent needs.

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 well-structured with a summary, 'When to use,' 'Behavioral notes,' and 'Returns' sections. Every sentence contributes concrete information, and the key purpose is front-loaded.

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?

For a tool with no output schema, the description compensates by listing the exact returned fields (row_count, columns, indexes, foreign_keys, size_bytes). It also covers use cases, performance caveats, error behavior, and parameter guidance, making it complete enough for an agent to invoke correctly.

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?

The input schema has 100% coverage with descriptions for both parameters, so the baseline is 3. The description adds little parameter-specific detail, but it doesn't need to; 'single table' reinforces the required table parameter and the return summary implicitly clarifies what the operation yields.

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 states a specific verb and resource: 'Returns detailed information about a single table' and enumerates exact contents (row count, columns, indexes, foreign keys, size). It also distinguishes this tool from list-like siblings by emphasizing 'single table' and 'go beyond the overview.'

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?

The description provides explicit 'When to use' bullets covering drill-down after db_overview, user questions, performance-sensitive query preparation, and debugging. It clearly explains the intended context, though it does not name a full set of alternatives or exclude cases where another sibling would be better.

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

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/cyberreinxy/pgautopilot'

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