Skip to main content
Glama

Plan keys and relationships (nothing deployed)

plan_backend
Read-only

Infers primary keys and relationships for the tables in a schema and proposes them as a plan. Requires workspace and source. Returns JSON: summary, keys and relationships each with the rule behind it (K0–K5, R0–R5), ambiguous columns, keyless tables, suggested composite keys and a Mermaid ER diagram. Rule R5 counts code and role columns the names left unlinked against the rows (read-only counting queries, at most 20, over the first 200 distinct values of a column); candidates it could not confirm are listed as proposed. Changes nothing in Fabric. validate_plan checks it against the rows; create_backend builds the API. Without schema, a source with several schemas that hold tables gets {choose_schema, schemas: [{schema, tables}], summary, hint} and nothing is planned (n169). 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": "plan_backend"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysNoPrimary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}.
detailNo"auto" (default: full up to 60 tables, else summary), "full" or "summary".auto
schemaNoSchema in the source; leave it out unless the user named one. Default: the only schema with tables; when the source has several, the answer lists them and asks which (choose_schema), and nothing is planned.
sourceYesLakehouse, warehouse or SQL database, name or id.
tablesNoTable names or globs to show. Default all. Example: ["sales_*"].
mermaidNofalse leaves the Mermaid ER diagram out of a full answer. Default true. Example: false.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / schema / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / schema / default
      Previous value: -"dbo"New value: +null
    • changedInput schema / properties / schema / description
      Previous value: -"Schema in the source. Default \"dbo\"."New value: +"Schema in the source; leave it out unless the user named one. Default: the only schema with tables; when the source has several, the answer lists them and asks which (choose_schema), and nothing is planned."
    • removedInput schema / properties / schema / type
      Removed value: -"string"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "plan_backendOutput",
      -  "type": "object"
      -}New value: +null
  2. Changed8 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 / detail / description
      Added value: +"\"auto\" (default: full up to 60 tables, else summary), \"full\" or \"summary\"."
    • 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 / mermaid / description
      Added value: +"false leaves the Mermaid ER diagram out of a full answer. Default true. Example: false."
    • 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 / tables / description
      Added value: +"Table names or globs to show. Default all. Example: [\"sales_*\"]."
    • addedInput schema / properties / workspace / description
      Added value: +"Fabric workspace, name or id."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With annotations already declaring readOnlyHint/openWorldHint/destructiveHint, the description still adds substantial behavior: exact JSON payload contents (summary, keys, relationships, ambiguous columns, Mermaid diagram), the R5 rule with its hard limits (at most 20 read-only counting queries, first 200 distinct values), an explicit 'changes nothing in Fabric' guarantee, and the {error, kind, hint} error shape.

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?

Very dense but front-loaded: the purpose is in sentence one, output shape next, then caveats and error handling. The parenthetical R5 sentence is long but each clause carries load. Minor deduplication possible where the schema-fallback behavior repeats the schema text.

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?

For an 8-parameter planning tool with no output schema, the description enumerates the return shape, the degradation path for multi-schema sources, the read-only query budget, and the error envelope, so an agent can both call it and interpret the answer without further input.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds real meaning on top: what happens when schema is omitted (choose_schema response and no planning), and the role of confirmed keys in building the plan. Other parameters (keys, detail, tables, mermaid) are left to 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?

Opens with a specific verb and resource: 'Infers primary keys and relationships for the tables in a schema and proposes them as a plan.' The 'proposes/nothing deployed' framing plus explicit handoffs to validate_plan and create_backend make it distinguishable from siblings like suggest_relationships or analyze_schema.

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?

Places the tool in a clear workflow: plan_backend proposes, validate_plan checks it against the rows, create_backend builds the API. It also gives concrete conditional guidance for omitting the schema parameter (choose_schema response). It stops short of explicitly excluding cases where suggest_relationships would be the better pick.

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.