Skip to main content
Glama

add_constraint

Add foreign key, check, or unique constraints to a Turso database table to enforce data integrity and relationships.

Instructions

Adiciona uma constraint (foreign key, check, unique) a uma tabela

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesNome da tabela
columnsYesColunas envolvidas na constraint
constraint_nameYesNome da constraint
constraint_typeYesTipo da constraint: 'FOREIGN KEY', 'CHECK', 'UNIQUE'
check_expressionNoExpressão CHECK (para CHECK constraints)
referenced_tableNoTabela referenciada (para FOREIGN KEY)
referenced_columnsNoColunas referenciadas (para FOREIGN KEY)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it only restates the action. It does not disclose that this is a mutating schema-altering DDL operation, whether it can fail when existing data violates the constraint, whether validation is immediate, or what happens to the table's data. For a mutation tool with zero annotation coverage, this is a significant gap.

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?

A single front-loaded sentence that states verb, resource, and scope with no filler. It is efficiently structured and immediately readable, though it could have used the space to add behavioral or conditional context without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a 7-parameter tool with conditional parameter dependencies and no annotations or output schema, so the description needs to compensate. It omits the conditional logic linking constraint_type to the optional parameters, error behavior on data violations, and the mutating nature of the operation. An agent cannot fully determine how to invoke it for each constraint type from this definition alone.

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%, so the schema already documents every parameter; the baseline of 3 applies. The description adds little beyond restating the constraint types already present in the enum, and it does not clarify the conditional relationships between constraint_type and the optional parameters (check_expression for CHECK, referenced_table/referenced_columns for FOREIGN KEY).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb ('Adiciona' = adds), a specific resource (a constraint on a table), and enumerates the supported types (foreign key, check, unique), which distinguishes it from siblings like add_column and create_index. However, it doesn't explicitly differentiate from the generic execute_ddl sibling, which could also add constraints via raw SQL, so it falls short of full differentiation.

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?

The description gives no guidance on when to use this tool versus alternatives. It never mentions execute_ddl as the fallback for custom DDL, nor does it state prerequisites (e.g., referenced table must already exist for foreign keys) or when a typed constraint tool is preferable to raw SQL.

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