Skip to main content
Glama

join-cardinality

Row multiplication, unmatched keys and uniqueness violations before a table join — Takes the join keys of two tables (every row's key, or distinct keys with row counts) and computes the exact output row count of an inner, left, right or full equi-join with SQL NULL semantics, the observed cardinality (one-to-one, one-to-many, many-to-one, many-to-many), the keys that multiply rows the most, unmatched keys on each side and the first duplicate row when a side was assumed unique. I

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": {
      "left": "<left>",
      "right": "<right>",
      "joinType": "<joinType>"
    },
    "name": "join-cardinality"
  }
}

Input Schema

NameRequiredDescriptionDefault
leftYes
rightYes
expectNo
joinTypeYes
normalizeNoNormalization your pipeline applies to string keys before joining.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose substantive behavior: SQL NULL semantics, the one-to-one/one-to-many/many-to-one/many-to-many classification, reporting of the keys that multiply rows most, unmatched keys per side, and the first duplicate row when uniqueness was assumed. It omits failure behavior when inputs exceed the documented key/count caps and says nothing about error reporting for expectation violations.

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?

One dense, front-loaded sentence that leads with the problem (row multiplication, unmatched keys, uniqueness violations) and then enumerates outputs — little waste. A stray trailing 'I' artifact and the run-on density are the only flaws.

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 complex nested-parameter tool with no output schema and no annotations, the description enumerates the return contents (output row count, cardinality, top multiplying keys, unmatched keys, first duplicate), which compensates well. Gaps remain around input size limits, the normalize parameter, and how failed expectations are surfaced.

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 low (20%), so the description must compensate. It does explain the two input modes ('every row's key, or distinct keys with row counts'), the join types, and implicitly the uniqueness and unmatched expectations, but it never mentions the normalize option (trim/caseFold) or the row-count ceiling, leaving several parameters to the thin schema text.

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?

Names a concrete verb set (computes output row count, cardinality, multiplying keys, unmatched keys, first duplicate) over a specific resource (equi-join between two key sets) and enumerates the supported join types. An agent can tell exactly what analysis it performs 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 phrase 'before a table join' implies pre-join validation as the usage context, but there is no explicit statement of when to prefer this tool, when not to, or how it relates to alternatives such as duplicate-key-audit. Guidance is inferable rather than stated.

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.

Resources