Skip to main content
Glama
MSSQL MCP Server

MSSQL MCP Server

by Elad-Health

get_foreign_keys

Retrieves foreign key relationships between SQL Server tables, optionally filtered by table, to map dependencies and understand schema relationships.

Instructions

Get foreign key relationships between tables

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": {
      "database": "<database>"
    },
    "name": "get_foreign_keys"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableNoFilter by table name (shows FKs from and to this table)
serverNoSQL Server instance (e.g., "server\instance" or "server,port"). Uses default if not specified.
databaseYesDatabase name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

B3.1/5.0
Behavior3/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. The verb 'Get' implies a read-only, non-destructive operation, which is useful, but the description says nothing about required permissions, whether cross-database references appear, or what the result contains. For a metadata read this is minimally adequate but leaves real behavioral questions unanswered.

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 short sentence with the resource front-loaded and no filler. It is efficiently sized, though the terseness comes at the cost of the guidance dimensions above.

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?

With no annotations and no output schema, the description is the only source of behavioral and return-shape information, and it provides neither. It does not say what a result row looks like (constraint name, referencing/referenced columns), which an agent needs to use the output correctly.

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%, and the schema itself explains the 'table' filter (FKs from and to the table) and the server/database parameters. The description adds no meaning beyond the schema, so the baseline of 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: 'Get foreign key relationships between tables.' This is clearly distinguishable from sibling metadata tools like get_columns, get_indexes, and get_tables. It stops short of 5 because it does not explicitly contrast itself with those adjacent metadata tools.

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 contains no when-to-use guidance, no prerequisites, and no mention of alternatives. An agent must infer from the name alone that this is the tool for constraint/relationship discovery rather than column or index metadata.

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