Skip to main content
Glama
codedb-io

codeDB Lens

Official

describe_table

Read-only

Inspect a table or view's columns, primary and foreign keys, indexes, and estimated row count before writing queries to verify column names and structure.

Instructions

Columns (type, nullable, default), primary key, foreign keys with the referenced table, indexes and estimated rows of one table or view. Use it before writing a query, so column names are right.

Input Schema

NameRequiredDescriptionDefault
tableYestable or view: schema.name, or name in the default schema
profileYesprofile name from list_profiles
databaseNodatabase name from list_databases; default: the profile's

Output Schema

NameRequiredDescriptionDefault
nameYes
typeYes
schemaYes
columnsYes
indexesYes
primary_keyYes
foreign_keysYes
estimated_rowsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so safety is covered; the description additionally signals that row counts are 'estimated' (i.e. catalog statistics, potentially approximate). Beyond that it does not describe freshness of the metadata, cost, or failure behavior for non-existent tables, and much of its return-content detail overlaps the output schema.

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 with no filler. The return inventory is front-loaded and the usage note follows economically, though leading with a noun phrase rather than a verb makes the opening marginally less scannable.

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?

With an output schema present, the description needn't explain return values, yet it still previews them, and it covers the when-to-use. Combined with 100% parameter coverage and read-only annotations, an agent has essentially everything needed to call it 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?

Schema description coverage is 100%: 'table' documents the schema.name/default-schema form, 'profile' points to list_profiles, and 'database' documents its default. The description adds no parameter meaning beyond this, so the baseline 3 applies.

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?

It enumerates the concrete resource of the operation — 'one table or view' — and lists the returned artifacts (columns with type/nullable/default, primary key, foreign keys with referenced table, indexes, estimated rows), which makes the scope unambiguous. It stops short of naming a sibling (e.g. list_tables) to contrast with, so it is clear but not differentiating.

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?

'Use it before writing a query, so column names are right' gives a concrete triggering situation rather than vague advice. There are no explicit exclusions or named alternatives, but the preparatory framing is enough to place it relative to query and list_tables.

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