Skip to main content
Glama
tspvivek
by tspvivek

baasix_create_schema

Create a new collection schema for Baasix with custom field types, validation rules, and schema options such as timestamps and soft deletes.

Instructions

Create a new collection schema in Baasix.

FIELD TYPES:

  • String: VARCHAR with values.length (e.g., 255)

  • Text: Unlimited text

  • Integer, BigInt: Whole numbers

  • Decimal: values.precision & values.scale

  • Float, Real, Double: Floating point

  • Boolean: true/false

  • Date, DateTime, Time: Date/time

  • UUID: With defaultValue.type: "UUIDV4"

  • SUID: Short unique ID with defaultValue.type: "SUID"

  • JSONB: JSON with indexing

  • Array: values.type specifies element type

  • Geometry, Geography: PostGIS spatial

  • Enum: values.values array

DEFAULT VALUE TYPES:

  • { type: "UUIDV4" } - Random UUID v4

  • { type: "SUID" } - Short unique ID

  • { type: "NOW" } - Current timestamp

  • { type: "AUTOINCREMENT" } - Auto-incrementing integer

  • { type: "SQL", value: "..." } - Custom SQL expression

  • Static values: "active", false, 0, etc.

VALIDATION RULES:

  • min: number - Minimum value (numeric fields)

  • max: number - Maximum value (numeric fields)

  • isInt: true - Must be integer

  • notEmpty: true - String cannot be empty

  • isEmail: true - Valid email format

  • isUrl: true - Valid URL format

  • len: [min, max] - String length range

  • is/matches: "regex" - Pattern matching

SCHEMA OPTIONS:

  • timestamps: true adds createdAt/updatedAt

  • paranoid: true enables soft deletes (deletedAt)

EXAMPLE: { "name": "Product", "timestamps": true, "fields": { "id": {"type": "UUID", "primaryKey": true, "defaultValue": {"type": "UUIDV4"}}, "sku": {"type": "SUID", "unique": true, "defaultValue": {"type": "SUID"}}, "name": {"type": "String", "allowNull": false, "values": {"length": 255}, "validate": {"notEmpty": true}}, "price": {"type": "Decimal", "values": {"precision": 10, "scale": 2}, "validate": {"min": 0}}, "email": {"type": "String", "validate": {"isEmail": true}}, "quantity": {"type": "Integer", "defaultValue": 0, "validate": {"isInt": true, "min": 0}} } }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYesSchema definition with name, fields, timestamps, paranoid options
collectionYesCollection name (lowercase, snake_case recommended)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.7

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations present, the description carries the burden of behavioral disclosure. It does this well by explaining concrete effects such as 'timestamps: true adds createdAt/updatedAt', 'paranoid: true enables soft deletes', and how different field types map to storage types like VARCHAR or JSONB. It does not mention error behavior, auth requirements, or what happens if a collection already exists.

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 long but well-organized into clear sections: FIELD TYPES, DEFAULT VALUE TYPES, VALIDATION RULES, SCHEMA OPTIONS, and EXAMPLE. The opening sentence states the purpose immediately, and every section earns its place by providing syntax-level detail needed to construct a valid payload.

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 creation tool with a complex nested schema parameter and no output schema or annotations, the description is largely complete. It specifies field types, defaults, validation rules, options, and an example. Missing details include return value/response format, behavior on duplicate collections, and auth/tenant expectations, but the core payload construction is fully covered.

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?

The input schema already documents both parameters and has 100% coverage, so the baseline is 3. The description adds substantial meaning for the `schema` parameter by enumerating field types, default value types, validation rules, and schema options, plus a full example. The `collection` parameter is not enriched beyond the schema description, and the relationship between `collection` and the schema's `name` field is not clarified.

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 opening sentence states a specific verb and resource: 'Create a new collection schema in Baasix.' The word 'new' distinguishes it from update, delete, or read schema operations, and the tool name aligns clearly with this purpose.

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 clearly implies this tool is for creating new schemas, but it never explicitly says when to use it versus alternatives like baasix_update_schema or baasix_list_schemas. There are no usage exclusions or prerequisites stated, so the agent must infer when this tool is the right choice.

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