Skip to main content
Glama
teghoz

sql-mcp

by teghoz

get_foreign_keys

Retrieve all foreign key relationships for a specified table by supplying schema and table names. Essential for exploring database schema dependencies.

Instructions

Get all foreign key relationships for a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name
schemaYesSchema name (e.g. dbo)
databaseNoDatabase name (defaults to the configured default database)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not explicitly state that the operation is read-only, has no side effects, or that it queries system catalog metadata. The verb 'Get' implies a query, but this is not explicit enough for a tool with no safety hints.

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 a single, front-loaded sentence that immediately conveys the action and target. It contains no redundant words and is appropriately sized for a simple metadata query.

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

Completeness2/5

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

The tool has no output schema, so the description should clarify what a 'foreign key relationship' entails (e.g., constraint name, referenced table/columns), but it does not. It also lacks mention of permissions or the default database behavior, leaving the agent with insufficient information about the return format and edge cases.

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?

The input schema covers all three parameters with descriptions (100% coverage), so the baseline is 3. The description itself adds no extra parameter detail beyond saying 'for a table', which matches the 'table' parameter. It does not clarify relationships between schema, table, and database or enhance the minimal schema descriptions.

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?

The description uses a specific verb ('Get') with a clear resource ('all foreign key relationships') and scope ('for a table'). This clearly distinguishes it from sibling tools like get_table_indexes, which are about indexes, and get_table_constraints, which could also include foreign keys but is broader.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention that get_table_constraints might also return foreign keys, nor does it specify that this tool is best for exploring referential integrity. There is no when-to-use or exclusionary context.

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/teghoz/sql-mcp'

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