Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

by berthojoris

list_constraints

Read-onlyIdempotent

Lists PRIMARY KEY, FOREIGN KEY, UNIQUE, and CHECK constraints for a table to reveal schema rules and relationships; optionally target a specific database.

Instructions

Lists 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": {
      "table_name": "<table_name>"
    },
    "name": "list_constraints"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseNoOptional: specific database name
table_nameYesName of the table

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.46.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered by structured data. The description's only added behavioral content is clarifying what 'constraint' encompasses, which is modest value. It says nothing about whether an omitted 'database' falls back to the current/default database, which is the one behavior an agent actually needs to know.

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?

One front-loaded sentence with the resource first and the enumerated constraint types as a compact parenthetical. Nothing is padded and nothing needs to be re-read.

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?

A simple read-only list tool with a fully documented two-parameter schema and annotations covering safety; the description is adequate for correct invocation. The only shortfall is silence on default-database resolution when the optional parameter is omitted, which is a minor gap for a tool of this complexity.

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 both parameters are already documented ('Optional: specific database name', 'Name of the table'). The description adds no format, casing, or resolution semantics beyond the schema, so the baseline of 3 applies.

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?

Specific verb ('Lists') plus a precise resource ('constraints') scoped to a single table, and it enumerates the constraint kinds returned (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK), so the agent knows exactly what content to expect. It does not, however, distinguish itself from sibling readers such as list_foreign_keys or list_indexes, which overlap on FOREIGN KEY output.

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?

There is no when-to-use or when-not-to-use guidance at all — no mention of when to prefer this over list_foreign_keys or list_indexes, and no prerequisites stated. The agent must infer selection purely from the resource name.

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