Skip to main content
Glama

dq_check_duplicates

Read-onlyIdempotent

Checks whether key columns uniquely identify rows and distinguishes exact duplicate records from conflicting duplicates with the same key but different values.

Instructions

Check whether key_columns are unique, and diagnose what kind of duplication it is.

Separates exact duplicate rows (the same record loaded twice: a re-run or overlapping incremental window) from conflicting duplicates (same key, different values: wrong grain or a join fan-out).

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": {
      "table": "<table>",
      "key_columns": "<key_columns>"
    },
    "name": "dq_check_duplicates"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYesTable name from dq_list_sources, e.g. 'orders' or 'warehouse.main.orders'.
sampleNo
key_columnsYesColumns that should uniquely identify a row, e.g. ['order_id'].

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), so the description's real contribution is the diagnostic taxonomy it returns: it will tell the caller whether duplicates are byte-identical rows or key-collisions with differing values. That is meaningful output semantics beyond the annotations, though it doesn't discuss cost or scale on large tables.

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?

Two sentences with the core purpose front-loaded and the diagnostic distinction laid out compactly with concrete parenthetical examples. Tight and readable, with only mild abstraction in the lead phrasing.

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 read-only, three-parameter check with an output schema and full safety annotations, the description supplies enough to understand the tool's purpose and the shape of its findings. The remaining gap is guidance on when to reach for it versus profiling or relationship checks.

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?

At 67% schema coverage, the schema already documents 'table' and 'key_columns' with examples. The description reinforces the meaning of key_columns ('should uniquely identify a row' is in the schema) but adds nothing about the unlabeled 'sample' parameter or how sampling interacts with the diagnostic result.

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?

A specific verb+resource ('Check whether key_columns are unique') plus a stated secondary function (diagnose the duplication type). The two-category framing (exact duplicate rows vs conflicting duplicates) makes it clearly distinct from siblings such as dq_check_nulls and dq_check_relationship.

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 parenthetical explanations of duplication causes ('re-run or overlapping incremental window' / 'wrong grain or a join fan-out') hint at when the check is warranted, but there is no explicit when-to-use, when-not-to-use, or routing to alternatives like dq_profile_table for broader uniqueness exploration.

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