Skip to main content
Glama

get-table-constraints

get-table-constraints
Read-onlyIdempotent

Retrieve PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, and CHECK constraints for a Firebird table, including constrained columns and referenced tables.

Instructions

Returns PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, and CHECK constraints for a table, including constrained columns and references.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYesName of the table whose relational metadata should be returned

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoFailure information; present when success is false
resultNoThe legacy JSON payload; present for completed operations and partial batches
successYesFalse for tool failures, including partially failed batches

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.12.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "__schema0": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        },
      +        {
      +          "items": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        }
      +      ]
      +    }
      +  },
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "error": {
      +      "additionalProperties": false,
      +      "description": "Failure information; present when success is false",
      +      "properties": {
      +        "details": {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        "message": {
      +          "type": "string"
      +        },
      +        "type": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "message",
      +        "type"
      +      ],
      +      "type": "object"
      +    },
      +    "result": {
      +      "additionalProperties": false,
      +      "description": "The legacy JSON payload; present for completed operations and partial batches",
      +      "properties": {
      +        "constraints": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "checkSource": {
      +                "type": "string"
      +              },
      +              "columns": {
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "indexName": {
      +                "type": "string"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "references": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "columns": {
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "table": {
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "table",
      +                  "columns"
      +                ],
      +                "type": "object"
      +              },
      +              "type": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "columns"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "tableName": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "tableName",
      +        "constraints"
      +      ],
      +      "type": "object"
      +    },
      +    "success": {
      +      "description": "False for tool failures, including partially failed batches",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success"
      +  ],
      +  "type": "object"
      +}
  2. Addedv2.10.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, openWorldHint=false and destructiveHint=false, so the safety profile is fully covered. The description adds only the scope of returned metadata, which largely duplicates what the output schema would carry; no notes on permissions, missing tables, or behavior for views.

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?

A single front-loaded sentence that states the resource first and the coverage second, with no filler or redundant qualifiers. Appropriately sized for a one-parameter read tool.

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?

With an output schema present, return-value detail is already documented, and annotations cover the safety profile, so the description only needs to identify scope. It does that well, though the constraint enumeration is somewhat redundant with the output schema and nothing is said about failure behavior for unknown tables.

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% and there is a single required parameter (tableName), so the schema already explains the parameter fully. The description adds no casing, qualification, or lookup semantics beyond what the schema provides, making 3 the correct baseline.

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?

Names a specific verb (Returns) and resource (table constraints) and enumerates the exact constraint categories covered (PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK). An agent can immediately distinguish this from siblings like get-table-indexes or get-table-triggers without opening a schema.

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?

Usage is implied by the resource name and the enumerated constraint types, but the description never states when to prefer this over describe-table, get-table-indexes, or get-table-triggers, nor any prerequisite (e.g. table must exist). Adequate but leaves routing to inference.

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