Skip to main content
Glama

create_database_schema

Create a complete database schema from a JSON specification, including tables, columns, relationships, and domains. Supports dry-run for preview and atomic rollback on failure.

Instructions

Create a whole database schema in one call from a JSON spec: {tables:[{name, code, comment, columns:[{name, code, data_type, length, precision, mandatory, default_value, comment, primary}], indexes:[...]}], relationships:[{parent_table, child_table, parent_columns, child_columns, name, cardinality}], domains:[...], indexes:[...]}. Primary keys are derived from columns with primary:true (or primary_key_columns). dry_run=true returns the execution plan without touching the model; atomic=true (default) rolls the model back if any step fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYes
atomicNo
dry_runNo
model_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries full behavioral burden and does well: it discloses that dry_run=true returns the execution plan without modifying the model, that atomic=true defaults to true, and that failures roll back the model. It also explains how primary keys are derived. This is genuinely useful behavioral context beyond the schema.

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?

The core purpose is front-loaded in the first sentence, and the rest compresses a lot of schema spec detail into a compact inline JSON sketch. It is dense but efficient; no filler.

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?

For a complex tool with nested objects and no output schema, the description covers the spec shape, atomic behavior, dry-run behavior, and primary-key derivation. A minor gap is that it doesn't describe what the normal (non-dry-run) call returns beyond implying side effects, but the provided detail is sufficient for correct invocation.

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 0%, so the description must compensate. It provides a detailed JSON spec structure for tables, columns, relationships, domains, and indexes, and clarifies the dry_run and atomic flags. model_id is not elaborated, but its meaning is largely self-evident from the parameter name and title.

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 ('Create') and resource ('whole database schema') and explicitly frames it as one call from a JSON spec. This clearly distinguishes it from granular siblings like create_table and create_column.

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

Usage Guidelines3/5

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

The phrase 'Create a whole database schema in one call' implies a batch-use scenario, but the description never explicitly says when to prefer this over the granular create_table/create_column tools or when not to use it. Usage context is implied rather than stated.

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