Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

by berthojoris

list_foreign_keys

Read-onlyIdempotent

Lists all foreign key constraints for a specified MySQL table, optionally within a chosen database, helping you inspect relationships and schema dependencies.

Instructions

Lists all foreign key constraints 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_foreign_keys"
  }
}

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

C2.9/5.0
Behavior2/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 adds nothing beyond that: no statement of what is returned (constraint names, referenced table/columns, update/delete rules) and no indication whether both declared and referencing foreign keys are included. With the annotation bar already met, this leaves the description essentially redundant.

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 no filler or redundancy. It is efficiently written, though the brevity comes at the cost of the guidance noted elsewhere.

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

Completeness3/5

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

This is a simple, two-parameter read tool with full schema coverage and complete annotations, so the description is minimally sufficient. It is still ambiguous on a point that matters for a foreign-key tool: whether results cover constraints defined on the table, constraints referencing it, or both, and what fields come back since there is no output schema.

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 table_name and the optional database parameter are already documented in the schema. The description only reinforces that the scope is a single table; it adds no meaning about how database defaults are resolved or whether fully qualified names are accepted. Baseline 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?

States a specific verb and resource: 'Lists all foreign key constraints for a table.' Clear about scope (per-table), so an agent can act without opening the schema. It does not distinguish itself from the sibling list_constraints, which plausibly overlaps, so it stops 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?

No when-to-use guidance, no exclusions, and no mention of the closely related list_constraints or get_all_tables_relationships tools. The agent must infer that this is the FK-specific counterpart purely from the tool name.

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