Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

by berthojoris

get_all_tables_relationships

Read-onlyIdempotent

Retrieves all table foreign-key relationships across a MySQL database in one query, returning a parent-child map to support schema discovery and data modeling.

Instructions

Gets ALL table foreign key relationships in the entire database in a single efficient query. Returns a comprehensive relationship map showing parent-child connections between all tables. Much faster than querying table-by-table.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_all_tables_relationships"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseNoOptional: specific database name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.46.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world behavior, so the safety profile is covered. The description contributes beyond that by disclosing the cost/performance trait ('single efficient query', 'much faster than querying table-by-table') and the shape of the result as a comprehensive map, which is genuinely decision-relevant.

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?

Three short sentences with the scope claim front-loaded and the performance rationale placed last. Every sentence carries information, though the third sentence partially restates the efficiency claim already implied by 'single efficient query'.

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?

For a simple single-parameter read tool with full annotation coverage, the description covers what it returns (a parent-child relationship map) and why to prefer it. No output schema exists, but the return shape is described in prose, so nothing critical is missing beyond the sibling differentiation noted above.

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?

There is only one optional parameter and schema coverage is 100%, so the schema already documents 'database' fully. The description adds nothing about how the optional database argument interacts with the claim of fetching relationships 'in the entire database', which is a mild ambiguity an agent might trip over. 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 with explicit scope: ALL foreign key relationships across the entire database, returned as a relationship map. The 'parent-child connections' phrase clarifies what a 'relationship' means. It falls short of a 5 because it never acknowledges the sibling 'list_foreign_keys', leaving the agent to guess how the two differ.

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?

Implies when to use it via the performance comparison ('much faster than querying table-by-table'), which effectively steers the agent away from per-table iteration. However, no sibling tool is named as an alternative, and there is no stated when-not-to-use condition (e.g., a single table's foreign keys).

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