Skip to main content
Glama

Suggest missing relationships, checked against the data

suggest_relationships
Read-only

Finds columns that look like references to another table's key but are in no relationship, ranks them and counts the best against the data (share of values found, distinct values). Requires workspace and source. Returns JSON candidates, each with a confirmed entry for plan_backend or create_backend. Read-only counting queries; applies nothing. Errors: {error, kind, hint}.

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": {
      "workspace": "<workspace>",
      "source": "<source>"
    },
    "name": "suggest_relationships"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysNoPrimary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}.
checkNoHow many top candidates are counted against the data. Default 15. Example: 5.
schemaNoSchema in the source. Default "dbo".dbo
sourceYesLakehouse, warehouse or SQL database, name or id.
confirmedNoRelationships the user confirmed, added to the plan. Default none. Example: [{"source": "orders", "source_cols": ["ship_to_id"], "target": "addresses", "target_cols": ["address_id"]}].
workspaceYesFabric workspace, name or id.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / check / description
      Added value: +"How many top candidates are counted against the data. Default 15. Example: 5."
    • addedInput schema / properties / confirmed / description
      Added value: +"Relationships the user confirmed, added to the plan. Default none. Example: [{\"source\": \"orders\", \"source_cols\": [\"ship_to_id\"], \"target\": \"addresses\", \"target_cols\": [\"address_id\"]}]."
    • addedInput schema / properties / keys / description
      Added value: +"Primary keys replacing the inferred ones. Default: inferred. Example: {\"order_items\": [\"order_id\", \"line_no\"]}."
    • addedInput schema / properties / schema / description
      Added value: +"Schema in the source. Default \"dbo\"."
    • addedInput schema / properties / source / description
      Added value: +"Lakehouse, warehouse or SQL database, name or id."
    • addedInput schema / properties / workspace / description
      Added value: +"Fabric workspace, name or id."
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and destructiveHint=false, but the description adds real behavioral context beyond them: it discloses that counting queries run against the data (share of values found, distinct values), that nothing is applied, and gives the error envelope shape {error, kind, hint}. Slight redundancy in restating 'read-only / applies nothing' keeps it from a 5.

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?

Front-loaded with the core action, then constraints, output shape, and error format in a tight block with zero filler. The telegraphic style ('Requires workspace and source', 'Errors: {error, kind, hint}') is efficient though slightly clipped.

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?

With annotations covering the safety profile and an output schema covering return values, the description still adds the data-validation behavior and error contract. It leaves unstated how candidates are ranked, what the returned candidate count is, or any threshold on the value-share, which is a modest gap for a 6-parameter tool.

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 the schema already documents keys, check, schema, source, and confirmed with defaults and examples. The description only loosely maps to parameters ('requires workspace and source', 'counts the best against the data' for check, confirmed entries for confirmed) and adds no syntax or format detail the schema lacks, so the baseline 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 and resource: finds columns that look like foreign-key references but aren't in a relationship, ranks them, and validates the top candidates against actual data. This is clearly distinguishable from siblings like analyze_schema (schema inspection) and data_dictionary (documentation), since it explicitly targets missing relationships with data-backed confirmation.

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

Usage Guidelines4/5

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

The description embeds the workflow context: results feed into plan_backend or create_backend via the confirmed entry, and required inputs (workspace, source) are called out. It does not explicitly say when NOT to use it versus analyze_schema or data_dictionary, so it falls short of a full 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.