Skip to main content
Glama

List tables

tables
Read-onlyIdempotent

List all database relations and views with approximate row counts to browse your schema. Start here before inspecting or querying specific data.

Instructions

List all tables and views of a connection/database with approximate row counts — the entry point for browsing. Use search_schema instead when you look for a concept (e.g. 'invoice') across table AND column names, and describe once you know the table. Returns tables[N]{name,kind,approx_rows} (kind = table|view; approx_rows is an estimate, may be null; use count for exact numbers). Returns every match, no pagination. On failure returns isError with 'error: ' (e.g. refused statement, unknown table, SQL error).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoOptional case-insensitive substring of the table name, e.g. order.
databaseNoOptional database to use instead of the connection's default (names from `databases`). Omit to use the default.
connectionYesConnection name exactly as returned by `connections` (e.g. "shop"). Unknown or unexposed names return an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.2
    • changedInput schema / properties / connection / description
      Previous value: -"Connection name (from `connections`)"New value: +"Connection name exactly as returned by `connections` (e.g. \"shop\"). Unknown or unexposed names return an error."
    • changedInput schema / properties / database / description
      Previous value: -"Database name to use instead of the connection's default (optional)"New value: +"Optional database to use instead of the connection's default (names from `databases`). Omit to use the default."
    • changedInput schema / properties / filter / description
      Previous value: -"Case-insensitive substring of the table name"New value: +"Optional case-insensitive substring of the table name, e.g. order."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower, yet the description still adds real behavioral context: it returns every match with no pagination, approx_rows may be an estimate or null, and failures surface as isError with an 'error: <reason>' payload including example causes. The only omission is nothing meaningful given the listed traits.

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 and tightly packed with routing guidance, return shape, and error behavior in three sentences. The 'with approximate row counts' clause is slightly restated in the return-shape sentence, a minor redundancy, but overall every sentence earns its place.

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, the description carries the full burden of describing the return shape (tables[N]{name,kind,approx_rows}, kind=table|view, nullable estimates), exhaustiveness, and the error contract. Nothing an agent needs to call this correctly or interpret results is missing.

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% and all three parameters are already documented in the schema (filter semantics, database defaulting, connection naming). The description adds no parameter-level syntax or format detail beyond what the schema provides, so the baseline of 3 applies.

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?

States a specific verb and resource ('List all tables and views of a connection/database with approximate row counts') and frames itself as 'the entry point for browsing', which immediately situates it among siblings. It explicitly contrasts itself with search_schema and describe, so an agent can distinguish it without opening any schema.

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 routing rules: use this for browsing, use `search_schema` when hunting a concept across table AND column names, use `describe` once the table is known, and use `count` for exact numbers. Both when-to-use and when-not-to-use are named with named alternatives.

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