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

dq-tier-status

Compare today's data quality scores per scope against Tier SLA targets and report meeting vs missing counts.

Instructions

Compare today's overall_score per scope against Tier SLA targets (Tier 1 99.5 / Tier 2 99.0 / Tier 3 95.0) and report meeting vs missing counts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoISO date (YYYY-MM-DD) to check, default = today

Implementation Reference

  • Main handler function for dq-tier-status. Queries the DQ score table for today's (or given date's) overall_score per scope, compares against Tier SLA targets (Tier 1=99.5, Tier 2=99.0, Tier 3=95.0), and returns meeting/missing counts. Has two code paths: 'generic' flavor (per-scope tier column) vs 'us-all' flavor (single daily row, compares against DQ_TIER1_TARGET_PCT).
    export async function dqTierStatus(args: z.infer<typeof dqTierStatusSchema>): Promise<unknown> {
      const flavor = getDqFlavor();
      const cols = getDqColumns(flavor);
      const backend = config.dq.backend;
    
      if (cols.tier) {
        // Generic schema: original Tier 1/2/3 rollup against per-scope rows.
        const useDate = args.date ?? null;
        const todayClause =
          backend === "bigquery" ? "CURRENT_DATE()" : "CURRENT_DATE";
        const sql = useDate
          ? `
            SELECT ${cols.tier} AS tier, ${cols.scope} AS scope, overall_score
            FROM ${scoreTable()}
            WHERE ${cols.scoreDate} = ?
            ORDER BY ${cols.tier}, ${cols.scope}`
          : `
            SELECT ${cols.tier} AS tier, ${cols.scope} AS scope, overall_score
            FROM ${scoreTable()}
            WHERE ${cols.scoreDate} = ${todayClause}
            ORDER BY ${cols.tier}, ${cols.scope}`;
        const result = await dqQuery(sql, useDate ? [useDate] : []);
        const targets: Record<string, number> = { "1": 99.5, "2": 99.0, "3": 95.0 };
        const summary: Record<string, { target: number; observations: number; meeting: number; missing: number }> = {};
        for (const row of result.rows) {
          const tier = String(row.tier ?? "");
          const score = Number(row.overall_score ?? 0);
          if (!summary[tier]) {
            summary[tier] = { target: targets[tier] ?? 0, observations: 0, meeting: 0, missing: 0 };
          }
          summary[tier].observations += 1;
          if (targets[tier] != null && score >= targets[tier]) summary[tier].meeting += 1;
          else summary[tier].missing += 1;
        }
        return { backend: result.backend, schema: flavor, rowsExamined: result.rowCount, tiers: summary, rows: result.rows };
      }
    
      // us-all flavor: no per-scope tier column. Fetch latest single row and
      // compare overall_score vs DQ_TIER1_TARGET_PCT (default 99.5).
      const useDate = args.date ?? null;
      const todayClause = backend === "bigquery" ? "CURRENT_DATE()" : "CURRENT_DATE";
      const sql = useDate
        ? `
          SELECT ${cols.scoreDate} AS score_date, overall_score, total_checks, failed_checks
          FROM ${scoreTable()}
          WHERE ${cols.scoreDate} = ?`
        : `
          SELECT ${cols.scoreDate} AS score_date, overall_score, total_checks, failed_checks
          FROM ${scoreTable()}
          WHERE ${cols.scoreDate} = ${todayClause}`;
      const result = await dqQuery(sql, useDate ? [useDate] : []);
      const target = defaultTier1TargetPct();
      const row = result.rows[0];
      const score = row ? Number(row.overall_score ?? 0) : null;
      const meeting = score == null ? null : score >= target;
      return {
        backend: result.backend,
        schema: flavor,
        target,
        score,
        meeting,
        totalChecks: row?.total_checks ?? null,
        failedChecks: row?.failed_checks ?? null,
        scoreDate: row?.score_date ?? null,
        notes: [
          `${flavor} schema has a single overall_score per day (no per-scope tiers). Comparing against DQ_TIER1_TARGET_PCT=${target}.`,
        ],
      };
    }
  • Zod schema for dq-tier-status input: optional 'date' (ISO YYYY-MM-DD), defaults to today.
    export const dqTierStatusSchema = z.object({
      date: z
        .string()
        .optional()
        .describe("ISO date (YYYY-MM-DD) to check, default = today"),
    });
  • src/index.ts:104-104 (registration)
    Registration of the 'dq-tier-status' tool with description and schema binding. Imported from quality-scores.ts on line 43.
    tool("dq-tier-status", "Compare today's overall_score per scope against Tier SLA targets (Tier 1 99.5 / Tier 2 99.0 / Tier 3 95.0) and report meeting vs missing counts", dqTierStatusSchema.shape, wrapToolHandler(dqTierStatus));
  • Helper function defaultTier1TargetPct() used by the us-all flavor branch of dqTierStatus. Returns DQ_TIER1_TARGET_PCT env var or defaults to 99.5.
    export function defaultTier1TargetPct(): number {
      const raw = parseFloat(process.env.DQ_TIER1_TARGET_PCT ?? "99.5");
      return Number.isFinite(raw) ? raw : 99.5;
    }
  • The dq-score-snapshot aggregation tool calls dqTierStatus({}) as a sub-component to include tier compliance data in the snapshot result.
    tier: () => dqTierStatus({}),
Behavior3/5

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

With no annotations, the description carries full burden. It clearly states a read-only comparative operation, but omits details like authentication needs, data freshness, or whether the operation has side effects. The behavioral profile is adequately disclosed for a simple query.

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, well-structured sentence that front-loads the purpose. Every word contributes meaning, with no redundancy or fluff.

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

Completeness3/5

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

Given the low complexity (1 optional parameter, no output schema), the description provides a reasonable overview. However, it does not specify the output format (e.g., structured JSON vs plain text) or clarify what 'scope' refers to, leaving some ambiguity for the agent.

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 single parameter 'date' is fully described in the schema (100% coverage). The description adds no additional semantic meaning beyond the schema's 'ISO date (YYYY-MM-DD) to check, default = today'. Baseline 3 is appropriate.

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 uses a specific verb 'compare' and identifies the resource 'overall_score per scope' against fixed Tier SLA targets, with a clear output of 'meeting vs missing counts'. It is distinct from sibling tools like dq-score-snapshot, which might show raw scores without tier comparison.

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 description implies usage for checking SLA compliance but provides no explicit guidance on when to use this tool versus alternatives (e.g., dq-score-snapshot). No when-not-to-use or prerequisite conditions are mentioned.

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