Skip to main content
Glama
EgCooper

MCP MySQL

by EgCooper

list_foreign_keys

Fetch foreign key constraints for a MySQL table or list all foreign keys in the current database. Filter by table name to inspect relationships.

Instructions

List foreign keys for one table, or all in the current database.

Args: table_name: Optional table name. Empty = all foreign keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations, so the description bears the full burden. It discloses the key behavioral trait that an empty table_name returns all foreign keys, but never confirms the operation is read-only or notes any limits/error behavior if a table does not exist.

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?

Two short sentences, front-loaded with the purpose, and the parameter note follows. The 'Args:' docstring formatting is slightly mechanical but adds no waste.

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?

An output schema exists, so return values need not be explained. For a single-parameter, read-only inspection tool, purpose and parameter semantics are covered; only read-only confirmation and error behavior are unstated, which are minor.

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 0%, so the description must compensate, and it does: table_name is documented as optional and empty meaning 'all foreign keys'. That fully disambiguates the single parameter's semantics beyond the bare schema.

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+resource ('List foreign keys') with clear scope: one table or the whole database. It is naturally distinguishable from list_tables, list_views, and list_indexes by resource, though it doesn't name any sibling explicitly.

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 (inspect FK relationships for a table or schema) but there is no explicit when-to-use guidance, no note on when to prefer describe_table instead, and no stated prerequisites such as needing an existing connection.

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