Skip to main content
Glama

Supabase: Get table constraints

supabase_get_table_constraints
Read-only

Retrieve all constraints—primary key, foreign key, unique, and check—for a specified Supabase table to understand its schema and enforce data integrity.

Instructions

[UNIFIED] Get all constraints (primary key, foreign key, unique, check) for a table.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site": "<site>",
      "table": "<table>"
    },
    "name": "supabase_get_table_constraints"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteYes
tableYes
schemaNopublic

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0
  2. Removedv3.13.1
  3. First observedv3.4.0

TDQS

B3.2/5.0
Behavior3/5

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

readOnlyHint=true already declares this is a safe read, so the bar is lower; the description adds value by specifying the exact payload content (the four constraint categories). However, it says nothing about behavior when the table is missing, on non-public schemas, or about result ordering/format, and no output schema exists to cover that.

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 with zero padding; the parenthetical listing the constraint types earns its place by defining scope. The '[UNIFIED]' prefix is noise that carries no meaning for tool selection.

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 3-parameter tool with 0% schema coverage and no output schema, the definition is too thin: site and schema are undocumented anywhere, and the description never indicates the shape of the returned constraint objects. Only the table and the constraint-type enumeration are adequately described.

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% for 3 parameters, but the description does natively cover what the key input means ('for a table'), so the table parameter's semantics are clear. It adds no information about the site parameter or the schema parameter (default 'public'), which remain fully undocumented for the agent.

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?

A specific verb ('Get') and resource ('constraints') plus an explicit enumeration of the constraint types returned (primary key, foreign key, unique, check), which distinguishes it from sibling tools like supabase_get_table_indexes and supabase_get_table_relationships. It never explicitly names those siblings as alternatives, keeping it just short of a 5.

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 states what the tool returns but gives no guidance on when to use it versus supabase_get_table_schema, supabase_get_table_indexes or supabase_get_table_relationships, nor any prerequisites (e.g. table must exist, required permissions). The agent must infer the selection criteria from the tool name alone.

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

Deploy Server

Other Tools