Skip to main content
Glama
S-CurveLabs

io.github.S-CurveLabs/sqlglass

Official
by S-CurveLabs

build_create_table

Read-only

Builds a CREATE TABLE script from a table name and column definitions, validates primary/foreign keys and indexes against the cached schema, returns SQL + undo SQL + notes; no DDL executed.

Instructions

Generate a CREATE TABLE script (TEXT ONLY -- this server never runs DDL; the user reviews and runs it). Checked against the cached schema: the name must be free, foreign keys must point at a real primary/unique key with the same column types, FK columns get an index, constraints get conventional names, and the script is wrapped in IF OBJECT_ID(...) IS NULL so it can be re-run. Returns sql + undo_sql + notes.

name: "dbo.VendorScore" columns: [{"name": "VendorScoreId", "type": "int", "identity": true}, {"name": "VendorId", "type": "int", "nullable": false}, {"name": "Score", "type": "decimal(5,2)", "nullable": false, "default": "0", "description": "0-100"}] primary_key: ["VendorScoreId"] foreign_keys: [{"columns": ["VendorId"], "references": "dbo.Vendor"}] (ref_columns default to the parent's primary key) indexes: [{"columns": ["ScoredOn"], "include": ["Score"], "unique": false}]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
columnsYes
indexesNo
connectionNo
descriptionNo
primary_keyNo
foreign_keysNo

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?

Annotations provide readOnlyHint: true, which the description aligns with by stating it never runs DDL. Beyond that, the description adds valuable behavior: it checks against cached schema, validates FK constraints, returns undo_sql, and wraps in IF OBJECT_ID(...) IS NULL. This goes beyond the annotation.

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 description is informative without being excessive. The key point (text-only script) is front-loaded, followed by checks and an example. The example is compact yet illustrates the expected structure. It is well-organized, though slightly long due to the example.

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?

Given the complexity (7 parameters, no output schema), the description covers the essential context: it returns sql + undo_sql + notes, it validates schema constraints, and it mentions naming conventions. It doesn't detail the return structure beyond that, but the agent can infer from the mention of sql/undo_sql/notes.

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 example for name, columns, primary_key, foreign_keys, and indexes, including defaults (e.g., ref_columns default to parent's primary key). This gives concrete meaning to the otherwise loosely typed parameters.

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 states a clear verb and resource: 'Generate a CREATE TABLE script'. It also specifies 'TEXT ONLY' and that the server never runs DDL, which distinguishes it from tools that execute (e.g., run_query). It is unambiguous about what the tool produces.

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 description implicitly defines usage: when you need to create a table. However, it does not explicitly mention alternatives like build_view or build_procedure, nor any exclusions. The context is clear but lacks explicit routing to siblings.

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