Skip to main content
Glama

get_table_context

Read a table's schema, joins, value lists, null shares, and notes from a dbprint snapshot before writing SQL or profiling its data.

Instructions

Read one table. Call it before writing SQL against a table, with purpose: query: DDL, the Joins list (declared foreign keys, joins dbprint inferred from column names or measured from values, and joins a person added, tagged annotated - minus any a person rejected; a join mentioned only in the table's prose description is not in it), a data dictionary, the value lists a predicate is written from, with their counts and coverage, and each nullable column's null share, plus notes that apply to the whole database. Call it with the default purpose: profile to describe the data - statistics such as null rates, cardinality and ranges, joins, the table's prose description and notes. Use search_columns or list_tables first when the table is not yet known, and resolve_value to check how one phrase is spelled in one column. Paged: md and yaml end every page but the last with a next_cursor line, json carries it as a key; a section too long for one page continues on the next, never dropped. Under profile, md Notes summarise each column - a long value list shows its 5 most frequent values - while json and yaml carry the statistics whole; for json/yaml a _corrupted field names any of the table's print files that failed to parse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesDotted fully-qualified table name, as list_tables and search_columns return it
cursorNo`next_cursor` from this call's previous page; omit for the first page
formatNomd renders the chosen purpose as Markdown - under `profile`, a per-column Notes summary rather than the raw statistics fields json and yaml carry. All three omit each column's sketch (a hashed summary of its distinct values); the table's raw statistics file, sketch included, is the dbprint://<connection>/<table>/statistics resource. get_reference document: guide explains each json/yaml field.md
purposeNoquery before writing SQL: DDL, the Joins list, data dictionary and the value lists with counts and coverage, and each nullable column's null share, with no other statistics. profile (default) to describe the data: statistics, relationships, notesprofile
connectionNoWhich database to read, by connection name; needed only when the server serves several, and the error for a missing one lists them. Omit it for the server's default
include_statsNoInclude the Cardinality table (md) or statistics object (json/yaml); no effect under `query`, which carries neither
include_annotationsNoInclude the notes and claims people wrote on its columns and values, and notes that apply to the whole database, when written
include_descriptionNoInclude the table's prose description, when one was written
include_relationshipsNoInclude the Relationships section (md) or relationships object (json/yaml); under `query`, the Joins list

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: it discloses pagination semantics (next_cursor line in md/yaml vs a json key, sections continue rather than being dropped), the _corrupted field for unparseable files, the md-vs-json/yaml rendering difference for Notes/statistics, and the omission of column sketches (pointing to the dbprint:// statistics resource). This is rich behavioral context an agent cannot get from structured fields.

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?

Front-loaded with the core action, then organized by concern (purpose modes, routing, paging, format differences). It is dense and long for a single paragraph, and the query-mode content list is partially restated in the schema, but nearly every sentence carries distinct operational information.

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?

With no output schema and no annotations across 9 parameters, the description compensates fully: it enumerates what each mode returns, how each format renders it, how paging terminates, and where to find raw statistics. Nothing an agent needs to call this correctly is missing.

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 100%, so the baseline is 3, but the description adds real meaning: it explains that query omits statistics while profile carries them, that include_stats has no effect under query, that connection is only needed on multi-database servers, and that include_relationships switches to the Joins list under query. It adds value beyond the per-parameter prose without fully re-specifying every default.

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?

Opens with a specific verb+resource ('Read one table') and immediately distinguishes the two modes (purpose: query vs the default profile) with concrete content lists for each. It names the siblings it is not (search_columns, list_tables, resolve_value) so the agent can route without opening other schemas.

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?

Gives explicit when-to-use instructions: call with purpose: query before writing SQL against a table, and use search_columns or list_tables first when the table is not yet known, with resolve_value for spelling checks. Alternatives and their triggering conditions are all stated, not implied.

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