Skip to main content
Glama
us-all
by us-all

dq-list-checks

List recent data quality check results filtered by dataset, status, type, and time window to monitor test outcomes and freshness.

Instructions

List recent rows from DQ_RESULTS_TABLE filtered by dataset / status / type / time window

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetNoFilter by dataset / source
statusNoFilter by status
typeNoFilter by check type (dbt_test | freshness | anomaly | reconciliation | ...)
sinceHoursNo
limitNo

Implementation Reference

  • Main handler function for dq-list-checks. Builds a SQL query to list recent rows from DQ_RESULTS_TABLE, applying optional filters for dataset, status, type, and a time window. Supports two schema flavors (generic/us-all) via column mapping.
    export async function dqListChecks(args: z.infer<typeof dqListChecksSchema>): Promise<unknown> {
      const flavor = getDqFlavor();
      const cols = getDqColumns(flavor);
      const backend = config.dq.backend;
      const filters: string[] = [];
      const params: unknown[] = [];
      if (args.dataset) {
        filters.push(`${cols.dataset} = ?`);
        params.push(args.dataset);
      }
      if (args.status) {
        filters.push(`LOWER(${cols.status}) = ?`);
        params.push(args.status);
      }
      if (args.type) {
        filters.push(`${cols.checkType} = ?`);
        params.push(args.type);
      }
      filters.push(tableTimeWindowSql(flavor, backend, "HOUR"));
      params.push(args.sinceHours);
      const where = "WHERE " + filters.join(" AND ");
    
      const checkNameSelect = cols.checkName
        ? cols.checkName + " AS check_name"
        : `(${cols.checkType} || ':' || COALESCE(${cols.tableName}, '')) AS check_name`;
    
      const sql = `
        SELECT ${checkNameSelect},
               ${cols.checkType} AS check_type,
               ${cols.dataset} AS dataset,
               ${cols.tableName} AS table_name,
               ${cols.status} AS status,
               ${cols.severity} AS severity,
               ${cols.failureCount} AS failure_count,
               ${cols.runAt} AS run_at,
               ${cols.message} AS message
        FROM ${resultsTable()}
        ${where}
        ORDER BY ${cols.runAt} DESC
        LIMIT ?`;
      params.push(args.limit);
      return { ...(await dqQuery(sql, params)), schema: flavor };
    }
  • Zod schema defining input parameters for dq-list-checks: dataset (optional string), status (optional enum pass/fail/warn/error), type (optional string), sinceHours (default 24, range 1-720), limit (default 100, range 1-500).
    export const dqListChecksSchema = z.object({
      dataset: z.string().optional().describe("Filter by dataset / source"),
      status: z.enum(["pass", "fail", "warn", "error"]).optional().describe("Filter by status"),
      type: z.string().optional().describe("Filter by check type (dbt_test | freshness | anomaly | reconciliation | ...)"),
      sinceHours: z.coerce.number().int().min(1).max(720).default(24),
      limit: z.coerce.number().int().min(1).max(500).default(100),
    });
  • src/index.ts:100-100 (registration)
    Registration of the dq-list-checks tool with the MCP server under the 'quality' category. Links the schema (dqListChecksSchema.shape) and handler (wrapToolHandler(dqListChecks)) to the tool name.
    tool("dq-list-checks", "List recent rows from DQ_RESULTS_TABLE filtered by dataset / status / type / time window", dqListChecksSchema.shape, wrapToolHandler(dqListChecks));
  • Column mapping helper that returns the actual DB column names for the two supported schema flavors (generic and us-all). The dq-list-checks handler calls getDqColumns() to build schema-agnostic SQL.
    export function getDqColumns(flavor: DqFlavor = getDqFlavor()): DqColumnMap {
      if (flavor === "us-all") {
        return {
          runAt: "run_date",
          checkType: "check_type",
          status: "status",
          dataset: "source",
          tableName: "target_name",
          severity: "dimension",
          failureCount: "metric_value",
          message: "details::text",
          checkName: null,
          scoreDate: "run_date",
          scope: null,
          tier: null,
        };
      }
      return {
        runAt: "run_at",
        checkType: "check_type",
        status: "status",
        dataset: "dataset",
        tableName: "table_name",
        severity: "severity",
        failureCount: "failure_count",
        message: "message",
        checkName: "check_name",
        scoreDate: "score_date",
        scope: "scope",
        tier: "tier",
      };
    }
  • Returns the qualified results table name (DQ_RESULTS_TABLE env var). Used by dq-list-checks handler to construct the FROM clause.
    export function resultsTable(): string {
      return qualifyTable(config.dq.resultsTable);
    }
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It does not state whether the operation is read-only, modifies state, or what side effects occur. The term 'list' implies a read, but for a tool with no annotations, more explicit safety context (e.g., 'This is a read-only operation that does not modify data') is expected.

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

Conciseness5/5

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

The description is a single sentence of 12 words, efficiently conveying the core purpose without any redundancy. Every word is meaningful, and the structure is front-loaded with the primary action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having 5 parameters and no output schema, the description omits critical details: the nature of DQ_RESULTS_TABLE, the order of results, the return format, and how multiple filters interact. 'Recent rows' is vague; the time window parameter (sinceHours) is mentioned but not precisely tied to 'recent'. The agent lacks sufficient context to fully understand the tool's behavior.

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?

The schema description coverage is 60%, with three parameters (dataset, status, type) having descriptions. The description adds a high-level mapping of these filter dimensions but does not explain sinceHours or limit beyond the schema's defaults and constraints. It partially compensates for the missing schema descriptions but provides no additional semantic depth (e.g., fuzzy matching, disjunction vs. conjunction of filters).

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 description clearly states the verb 'List' and the resource 'rows from DQ_RESULTS_TABLE', and explicitly lists the filter dimensions (dataset, status, type, time window). This differentiates it from sibling tools like dq-failed-checks-by-dataset and dq-get-check-history, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives (e.g., dq-failed-checks-by-dataset for only failures, dq-get-check-history for historical records). There are no explicit when-to-use or when-not-to-use instructions, leaving the agent to infer context from the tool name alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/us-all/dbt-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server