Skip to main content
Glama

get_db_schema

Read-onlyIdempotent

Retrieve a condensed Postgres schema snapshot from SQL migrations to inspect tables, columns, keys, indexes, and RLS policies.

Instructions

Condensed SQL-migration snapshot: tables (cols, types, nullability, defaults), PKs, FKs, indexes, RLS policies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tablesNoOptional filter: only return these table names.
dialectNoSQL dialect -- currently only 'postgres' is implemented.
projectNoProject name/path (default: active).
migrations_dirNoRelative or absolute path to the migrations directory (default: auto-detect).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly=true, idempotent=true, non-destructive=true and closed-world, so the safety profile is fully covered. The description adds one useful behavioral fact beyond that: the data comes from migrations ('condensed SQL-migration snapshot') rather than live introspection, which affects staleness expectations. It does not disclose truncation, size limits, or cost of the call.

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?

A single front-loaded sentence that enumerates the return contents with zero filler. Every token earns its place.

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 no output schema, the description carries the return-value burden and does so by listing the schema elements returned. Combined with complete parameter coverage and full annotations, an agent has nearly everything needed; only the migration-vs-live distinction and result size/pagination are unstated.

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%, with each of the four parameters (tables, dialect, project, migrations_dir) fully documented including defaults and the 'postgres only' constraint. The description adds nothing beyond the schema, so the baseline 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 resource (database schema) and enumerates exactly what the snapshot contains: tables with columns/types/nullability/defaults, PKs, FKs, indexes, and RLS policies. None of the sibling tools return DB schema, so an agent can distinguish this from get_structure_summary or get_file_dependencies immediately.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance, no mention of alternatives, and no stated prerequisites. The migration-derived nature of the snapshot is implied by 'SQL-migration' but never explained as a usage condition, and there is no hint that a live-DB variant might be the alternative.

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