Skip to main content
Glama

create_primary_key

Create or replace a table's primary key from specified column codes, supporting single and composite keys. Clears existing PK membership and includes a dry-run option for safe validation.

Instructions

Create (or replace) the primary key of a table from the given column codes. Supports single-column and composite keys, e.g. columns=['order_id','product_id']. Existing PK membership is cleared. Supports dry_run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
nameNo
columnsYes
dry_runNo
model_idYes
table_refYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

With no annotations provided, the description must disclose behavioral traits on its own. It does state that existing PK membership is cleared and that dry_run is supported, which are important. However, it omits details such as potential side effects on indexes or transactions, and does not mention permissions or reversibility.

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 two sentences with a clear example, front-loaded with the purpose and key behavioral note. Every word earns its place with no filler.

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?

For a tool with six parameters and no output schema, the description is incomplete. It lacks details on return values, the exact format of model_id and table_ref, the roles of code and name, and a precise definition of dry_run. It also fails to differentiate from set_primary_key, leaving ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/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 explains the 'columns' parameter via the example and 'column codes', but leaves model_id, table_ref, code, name, and dry_run unexplained. This is a significant gap for a tool with six parameters.

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 clearly states a specific action: create or replace the primary key of a table from column codes, with a concrete example. It is unambiguous about the resource and verb, but it does not explicitly differentiate from the sibling tool set_primary_key, which overlaps in purpose.

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?

No guidance is given on when to use this tool versus set_primary_key or remove_primary_key. There is no mention of conditions, alternatives, or exclusions, leaving the agent without selection criteria.

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