Skip to main content
Glama

Shortest join path between two tables

join_path
Read-only

Finds the shortest chain of relationships between two tables. Requires workspace, source, start and end. Returns JSON with each hop and its rule, every equally short path and a T-SQL SELECT … JOIN; without a path, the missing relationship as a confirmed entry. Metadata only; changes nothing. answer_query_draft drafts a query for a whole question. 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>",
      "start": "<start>",
      "end": "<end>"
    },
    "name": "join_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
endYesTable the path ends at. Example: "customers".
keysNoPrimary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}.
startYesTable the path starts at. Example: "order_items".
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. Changed7 schema fields changed
    • 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 / end / description
      Added value: +"Table the path ends at. Example: \"customers\"."
    • 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 / start / description
      Added value: +"Table the path starts at. Example: \"order_items\"."
    • addedInput schema / properties / workspace / description
      Added value: +"Fabric workspace, name or id."
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, and the description reinforces that with 'Metadata only; changes nothing.' More valuable, it discloses non-obvious behavior: it returns every equally short path, emits a T-SQL SELECT … JOIN, and falls back to a confirmed missing-relationship entry when no path exists, plus the error shape {error, kind, hint}.

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 purpose and packed with useful specifics in a few sentences. The return-value clause is compressed into telegraphic fragments ('without a path, the missing relationship as a confirmed entry'), which costs some readability but wastes no words.

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 an output schema present, return format needn't be explained, yet the description covers returns, tie handling, no-path fallback and error structure, and the annotations cover safety. What's missing is guidance on when the optional confirmed/keys inputs matter in practice, but that is covered adequately by the schema examples.

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 defines workspace, source, start, end, keys, schema and confirmed with examples. The description only restates the four required parameters ('Requires workspace, source, start and end') and adds no semantics for keys, confirmed or schema that isn't already in the schema.

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 first sentence states a specific verb and resource: finds the shortest chain of relationships between two tables. It is unambiguous and, combined with the closing routing note about answer_query_draft, an agent can tell what this tool does versus a sibling without opening the schema.

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?

The description names one alternative (answer_query_draft drafts a query for a whole question), which implicitly narrows this tool to pairwise table-path discovery. However, it never states an explicit when-to-use or when-not-to-use condition, and it doesn't mention suggest_relationships or analyze_schema, which are also plausible choices.

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.