Skip to main content
Glama

table_index

Destructive

Create indexes and unique keys on a data table (a unique key makes INSERT ... ON CONFLICT work). One call is one atomic step.

Operations:

  • {"op":"create_index","columns":["bank_id"]} — optional name, unique, method (btree default) and where for a partial index, e.g. "where":"status = 'suggested'". Without a name the server derives one from table and columns, so a repeat does not duplicate it (applied: [], note already_exists).

  • {"op":"add_unique","columns":["side","line_id"]} — refused with DUPLICATE_VALUES and a sample of the duplicates when the data is not unique.

  • {"op":"drop_index","name":"..."} — DESTRUCTIVE

  • {"op":"drop_constraint","name":"..."} — DESTRUCTIVE

Destructive operations need a person: the call returns APPROVAL_REQUIRED with approval.requestId and a card in the chat that lists the workflows using this table. Do not retry; the person's decision starts your next turn. Failures return success:false, code, operationIndex and the database message unchanged.

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": {
      "operations": "<operations>"
    },
    "name": "table_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableIdNoTable ID. Supply exactly one of tableId or tableName.
tableNameNoExact, case-sensitive accessible table name or SQL table slug; preferred when known. table, name and table_name are accepted aliases. Supply exactly one of tableName or tableId.
operationsYesArray of operations (a JSON string is also accepted). Example: [{"op":"add_unique","columns":["match_id"]}]
approvalRequestIdNoOptional. The requestId of an earlier APPROVAL_REQUIRED result, to read its outcome. It never approves anything: only a person can, on the card in the chat.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the destructiveHint=true annotation: name derivation makes repeats idempotent ('applied: [], note already_exists'), add_unique fails with DUPLICATE_VALUES plus sample rows, drops are flagged DESTRUCTIVE and gated by APPROVAL_REQUIRED with a requestId and chat card. The error envelope (success:false, code, operationIndex, raw DB message) and the atomicity of a call are also disclosed.

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?

Front-loaded summary followed by a tight bulleted operation list, then one short paragraph on approvals and errors; every line carries information. Slightly dense and uses unexplained shorthand (DUPLICATE_VALUES, APPROVAL_REQUIRED) inline, but no filler.

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

Completeness5/5

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

With no output schema, the description carries the return-value burden and does so: applied/note already_exists on success, success:false plus code and operationIndex on failure, and the APPROVAL_REQUIRED payload shape. Complete for a destructive, multi-operation tool.

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 coverage is 100%, so the schema already documents tableId/tableName/operations/approvalRequestId. The description still adds meaning the schema does not: the shape of each operation object, the optional name/unique/method/where fields, and the fact that approvalRequestId only reads an outcome and never approves.

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?

States a specific verb and resource ('Create indexes and unique keys on a data table') and then enumerates every supported operation with concrete JSON payloads. An agent can immediately distinguish this from sibling schema-mutation tools like table_alter or table_create.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives per-operation examples and a clear procedural rule for the approval flow ('do not retry; the person's decision starts your next turn'). It does not explicitly say when to prefer this over table_alter for closely related schema changes, so routing between siblings still requires inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.