Skip to main content
Glama

get_schema

Discover database structure by listing tables, columns, foreign keys, and indexes. Supports ERD diagram generation with Mermaid format.

Instructions

Discover database schema - tables, columns, relationships, indexes.

LEVEL: Database (lists all schemas) or Schema (specific schema details)

USE FOR: listing tables, columns, foreign keys, ERD generation. DO NOT USE FOR: table data (execute_query), index health (maintenance_analysis).

ERROR RECOVERY:

  • "schema not found": Call get_schema() without params to list all schemas

  • "no tables found": Schema exists but is empty, verify with execute_query

  • "not connected": Call connect() first or pass url parameter

PAGINATION: For large schemas (100+ tables), use limit/offset.

Examples: get_schema() - List all schemas get_schema(schema='public') - Tables in public get_schema(schema='public', limit=50, offset=50) - Page 2 get_schema(format='mermaid') - ERD diagram

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema name. Omit or 'all' for all schemas; specific name for tables.
formatNoOutput formatjson
limitNoMax tables to return (1-500)
offsetNoSkip first N tables (for pagination)
urlNoDatabase URL for auto-connection

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries full behavioral transparency burden. It discloses error recovery scenarios, pagination limits, and format options. It also explains behavior with and without parameters. However, it does not explicitly state read-only nature, but it's implied.

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?

The description is well-structured with clear sections (LEVEL, USE FOR, DO NOT USE FOR, ERROR RECOVERY, PAGINATION, Examples). Every sentence provides useful information without redundancy. It is concise yet comprehensive.

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?

Given 5 parameters, presence of an output schema, and context from sibling tools, the description is complete. It covers all relevant aspects: purpose, usage boundaries, parameter details, error recovery, pagination, and format options. No gaps remain.

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 description coverage is 100% for all 5 parameters. The description adds value by explaining how to use parameters for pagination (limit/offset), format output (mermaid for ERD), and auto-connection via url. Examples demonstrate typical usage patterns beyond the schema alone.

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?

The description explicitly states it discovers database schema (tables, columns, relationships, indexes). It also distinguishes from siblings like execute_query and maintenance_analysis. The verb 'discover' combined with 'database schema' gives a specific resource and action.

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?

The description includes explicit 'USE FOR' and 'DO NOT USE FOR' sections, listing when to use this tool (listing tables, columns, foreign keys, ERD generation) and when not to (use execute_query for data, maintenance_analysis for index health). Error recovery and pagination guidance are also provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/snss10/DBeast'

If you have feedback or need assistance with the MCP directory API, please join our Discord server