Skip to main content
Glama

dbt schema.yml with source tests

dbt_schema
Read-only

Writes a dbt sources file: unique and not_null on key columns, relationships tests on single-column relationships, composite ones as comments. project=true: a dbt project draft for dbt-fabric 1.12 on dbt-core 1.12 (Fabric Warehouse T-SQL): typed, de-duplicated staging models; marts per domain joined only over relationships check_rows counted many-to-one, child facts summed before the join; untemplated parts and TODOs listed. quality: the same checks as Great Expectations and/or Soda drafts; profile: a Fabric profiles.yml. Can sit beside dbt Labs' dbt-mcp, which runs dbt. Requires workspace and source. Returns YAML text, or JSON files for a project. Read-only (check_rows counts rows); creates nothing, runs no dbt. 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": "dbt_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysNoPrimary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}.
fixesNoIds from validate_plan(fixes=true).
schemaNoSchema in the source. Default "dbo".dbo
sourceYesLakehouse, warehouse or SQL database, name or id.
tablesNoTable names or globs to show. Default all. Example: ["sales_*"].
profileNoWith project=true: adds a profiles.yml for Fabric with placeholders and no secret. Default false.
projectNotrue: a whole dbt project as files (staging, marts per domain) instead of the sources file. Default false. Example: true.
qualityNoAlso drafts the same key and relationship checks as a Great Expectations suite per table ("gx"), as SodaCL checks ("soda") or both ("both"), each with its rule and counts. Default none.
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.
check_rowsNotrue: with row counts. Default false.
source_nameNoName of the dbt source. Default: the schema name. Example: "shop".
arguments_blockNotrue (default) puts test arguments under arguments: (dbt 1.10.5+); false writes them top-level for older dbt. Example: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "dbt_schemaOutput",
      -  "type": "object"
      -}New value: +null
  2. Changed1 schema field changed
    • addedInput schema / properties / fixes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {},
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Ids from validate_plan(fixes=true).",
      +  "title": "Fixes"
      +}
  3. Changed4 schema fields changed
    • addedInput schema / properties / check_rows
      Added value: +{
      +  "default": false,
      +  "description": "true: with row counts. Default false.",
      +  "title": "Check Rows",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / profile
      Added value: +{
      +  "default": false,
      +  "description": "With project=true: adds a profiles.yml for Fabric with placeholders and no secret. Default false.",
      +  "title": "Profile",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / project
      Added value: +{
      +  "default": false,
      +  "description": "true: a whole dbt project as files (staging, marts per domain) instead of the sources file. Default false. Example: true.",
      +  "title": "Project",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / quality
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Also drafts the same key and relationship checks as a Great Expectations suite per table (\"gx\"), as SodaCL checks (\"soda\") or both (\"both\"), each with its rule and counts. Default none.",
      +  "title": "Quality"
      +}
  4. Changed8 schema fields changed
    • addedInput schema / properties / arguments_block / description
      Added value: +"true (default) puts test arguments under arguments: (dbt 1.10.5+); false writes them top-level for older dbt. Example: false."
    • 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 / source_name / description
      Added value: +"Name of the dbt source. Default: the schema name. Example: \"shop\"."
    • 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."
  5. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false, openWorldHint), and the description adds real context on top: "Read-only (check_rows counts rows)" flags the one non-read side effect, and "creates nothing, runs no dbt" resolves the tension with the verb "writes". It also discloses the return shape ("YAML text, or JSON files for a project") and the error envelope {error, kind, hint}, which annotations do not carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening clause is correctly front-loaded, but the body degenerates into a dense run-on with colon-and-semicolon chaining: "marts per domain joined only over relationships check_rows counted many-to-one, child facts summed before the join" is hard to parse and reads as notes rather than guidance. The mode list would be far scannable as short discrete clauses.

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?

For a 13-parameter, multi-mode generator with no output schema, the description covers the essential contract: required inputs, what varies per mode, that output is text rather than side effects, and the error shape. The remaining gap is that the combinatorial interactions between project, quality, profile and arguments_block are only loosely signaled.

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% across all 13 parameters, so the schema already documents keys, fixes, tables, confirmed, source_name and arguments_block. The description mainly restates the mode flags (project, quality, profile, check_rows) at schema-level fidelity rather than adding new meaning. Marginal value comes from explaining how project=true changes the artifact class, but that is also in the schema.

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?

Opens with a specific verb and artifact: "Writes a dbt sources file", then enumerates exactly which tests it emits (unique/not_null on keys, relationships, composite as comments). The mode flags (project, quality, profile) are each stated in terms of the new output they produce. It does not differentiate against the concrete siblings an agent would actually weigh (analyze_schema, data_dictionary, plan_backend); the only contrast offered is with an external tool, dbt Labs' dbt-mcp.

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?

"Requires workspace and source" states the prerequisite, and "Can sit beside dbt Labs' dbt-mcp, which runs dbt" plus "creates nothing, runs no dbt" tell the caller when this is and is not the right tool. What is missing is task-side routing — nothing says when to pick this over analyze_schema or plan_backend, so the caller must infer that from the output artifact.

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.