Skip to main content
Glama
db-conn-mcp

db-conn-mcp

list_tables

Read-onlyIdempotent

Lists tables and views in a configured database, optionally filtering by name and limiting results, so you can find exact table or view names without dumping every object.

Instructions

List all tables and views in the named database.

Use this to find a table's exact name. For its columns and keys use get_table_schema; to find which table holds a column, use find_columns; for every table's columns at once, get_database_schema.

Narrow instead of listing everything: pattern keeps only names containing it (fuzzy, case-insensitive — "order" matches ORDERS, order_items). limit returns at most that many rows, so a huge database can't flood the answer.

Returns meta and tables, one item per table or view with schema, name and kind (table or view). With limit set, meta.truncated is true when more tables matched than were returned.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>"
    },
    "name": "list_tables"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoReturn at most this many items; `meta.truncated` is then true when more matched. Omit to return every match.
patternNoKeep only tables whose name contains this text, case-insensitively: 'order' matches ORDERS and order_items. Omit for every table.
databaseYesName of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names.

Output Schema

NameRequiredDescriptionDefault
metaYes
tablesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.8.1
    • addedInput schema / properties / database / description
      Added value: +"Name of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names."
    • addedInput schema / properties / limit / description
      Added value: +"Return at most this many items; `meta.truncated` is then true when more matched. Omit to return every match."
    • addedInput schema / properties / pattern / description
      Added value: +"Keep only tables whose name contains this text, case-insensitively: 'order' matches ORDERS and order_items. Omit for every table."
  2. Changed6 schema fields changedv0.8.0
    • addedOutput schema / $defs
      Added value: +{
      +  "Meta": {
      +    "description": "The first key of every tool's answer: what came back, and how long it took.\n\nnull means the field does not apply to the tool, or the tool cannot know it.",
      +    "properties": {
      +      "database": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Database"
      +      },
      +      "elapsed_ms": {
      +        "title": "Elapsed Ms",
      +        "type": "integer"
      +      },
      +      "row_count": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Row Count"
      +      },
      +      "tool": {
      +        "title": "Tool",
      +        "type": "string"
      +      },
      +      "truncated": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Truncated"
      +      }
      +    },
      +    "required": [
      +      "tool",
      +      "database",
      +      "row_count",
      +      "truncated",
      +      "elapsed_ms"
      +    ],
      +    "title": "Meta",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / meta
      Added value: +{
      +  "$ref": "#/$defs/Meta"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "items": {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  "title": "Result",
      -  "type": "array"
      -}
    • addedOutput schema / properties / tables
      Added value: +{
      +  "items": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "title": "Tables",
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "meta",
      +  "tables"
      +]
    • changedOutput schema / title
      Previous value: -"list_tablesOutput"New value: +"ListTablesResult"
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds behavior the annotations do not: that `pattern` is fuzzy and case-insensitive, that `limit` caps rows so a huge database can't flood the answer, and that `meta.truncated` flags overflow. It omits error/permission behavior, which is left to the schema's note about unknown database names.

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 purpose, then sibling routing, then parameter behavior and return shape — a sensible order with no filler sentences. It loses a point because the `pattern` and `limit` explanations duplicate the schema descriptions almost verbatim rather than building on them.

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 an output schema present, the description needn't detail return values, yet it still summarizes `tables` items as schema/name/kind and the truncation contract. Combined with full parameter coverage and strong annotations, an agent has everything needed to call this 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% and the schema already explains `database`, `pattern`, and `limit` including the truncation flag. The description largely restates these (including the same 'order' matches ORDERS/order_items example), adding only the strategic framing 'narrow instead of listing everything'. Baseline 3 is appropriate when the schema carries the parameter detail.

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 in the named database') with an explicit scope. It immediately distinguishes itself from schema-level siblings by naming get_table_schema, find_columns, and get_database_schema, so an agent can route correctly 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 when-to-use routing: use this to find a table's exact name, use get_table_schema for columns and keys, find_columns to locate a column's table, get_database_schema for everything at once. It also adds a usage strategy — narrow with `pattern`/`limit` instead of listing everything — which is genuine guidance, not inference.

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