Skip to main content
Glama
jigarkkarangiya

magento-sql-mcp-server

Get Foreign Keys

get_foreign_keys
Read-onlyIdempotent

Get foreign key relationships for a Magento table from INFORMATION_SCHEMA to understand referential links before constructing JOIN queries.

Instructions

Returns foreign key relationships for a table from INFORMATION_SCHEMA. Use before writing JOINs to understand referential links. Use describe_table for column details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesMagento database table name (e.g. sales_order, catalog_product_entity).
profileNoOverride the MAGENTO_SQL_PROFILE env var for this call only. Use list_connection_profiles to see available names.
magentoRootNoAbsolute path to the Magento root (must contain app/etc/env.php). Defaults to MAGENTO_ROOT env var or auto-discovery.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
rowsYes
sampledNo
rowCountYes
truncatedNo
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds the source (INFORMATION_SCHEMA) and the purpose, which is useful behavioral context beyond the annotations. It does not mention performance or failure modes, but given the annotations' strength, this is acceptable.

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?

The description is two sentences with zero waste. The primary action is front-loaded, followed by usage guidance and an alternative. Every word earns its place.

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

Completeness5/5

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

The tool is simple, all parameters are documented in the schema, and an output schema exists (so return format is not the description's responsibility). The description provides sufficient context for an agent to call the tool correctly without missing information.

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 all three parameters (table, profile, magentoRoot) already have descriptions that explain their meaning and defaults. The description adds no extra parameter context, so with high coverage the baseline of 3 is appropriate.

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?

States a specific verb ('Returns') and resource ('foreign key relationships for a table') and names the source ('from INFORMATION_SCHEMA'). It clearly distinguishes from siblings like describe_table and get_table_indexes, so an agent knows exactly what this tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs when to use: 'Use before writing JOINs to understand referential links.' It also names the alternative for column details ('Use describe_table'), making the decision between tools unambiguous.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jigarkkarangiya/magento-sql-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server