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

dq-score-snapshot

Aggregates 4-axis score trend, today's Tier compliance, and lists most recent failing checks for a data quality snapshot.

Instructions

Aggregated 4-axis score trend + today's Tier compliance + most recent failing checks. Combines dq-score-trend + dq-tier-status + dq-list-checks(fail).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
includeFailingNoAlso include the most recent failing checks

Implementation Reference

  • The main handler function for 'dq-score-snapshot'. Takes a 'days' param (1-90, default 7) and optional 'includeFailing' flag. Calls aggregate() to concurrently invoke dqScoreTrend, dqTierStatus, and dqListChecks (failing only), returning a combined snapshot with trend, tier, and failingTop results.
    export const dqScoreSnapshotSchema = z.object({
      days: z.coerce.number().int().min(1).max(90).default(7),
      includeFailing: z.boolean().default(true).describe("Also include the most recent failing checks"),
    });
    
    export async function dqScoreSnapshot(args: z.infer<typeof dqScoreSnapshotSchema>): Promise<unknown> {
      const caveats: string[] = [];
      const { trend, tier, failing } = await aggregate(
        {
          trend: () => dqScoreTrend({ days: args.days }),
          tier: () => dqTierStatus({}),
          failing: () =>
            args.includeFailing
              ? dqListChecks({ sinceHours: args.days * 24, status: "fail", limit: 10 })
              : Promise.resolve(null),
        },
        caveats,
      );
      return { days: args.days, trend, tier, failingTop: failing, caveats };
    }
  • Zod schema defining the input for dq-score-snapshot: 'days' (coerced int, 1-90, default 7) and 'includeFailing' (boolean, default true) to control inclusion of recent failing checks.
    export const dqScoreSnapshotSchema = z.object({
      days: z.coerce.number().int().min(1).max(90).default(7),
      includeFailing: z.boolean().default(true).describe("Also include the most recent failing checks"),
    });
  • src/index.ts:107-107 (registration)
    Registration of the 'dq-score-snapshot' tool with description, schema binding (dqScoreSnapshotSchema.shape), and handler (wrapToolHandler(dqScoreSnapshot)).
    tool("dq-score-snapshot", "Aggregated 4-axis score trend + today's Tier compliance + most recent failing checks. Combines dq-score-trend + dq-tier-status + dq-list-checks(fail).", dqScoreSnapshotSchema.shape, wrapToolHandler(dqScoreSnapshot));
  • src/index.ts:45-50 (registration)
    Import of dqScoreSnapshotSchema and dqScoreSnapshot from src/tools/aggregations.ts into the main server file where the tool is registered.
    import {
      failedTestsSummarySchema, failedTestsSummary,
      freshnessStatusSchema, freshnessStatus,
      dqScoreSnapshotSchema, dqScoreSnapshot,
      incidentContextSchema, incidentContext,
    } from "./tools/aggregations.js";
  • wrapToolHandler utility (from @us-all/mcp-toolkit) that wraps all tool handlers with error handling, redaction patterns, and structured error extraction.
    export const wrapToolHandler = createWrapToolHandler({
      redactionPatterns: [
        /PG_CONNECTION_STRING/i,
        /-----BEGIN[^-]+-----[\s\S]*?-----END[^-]+-----/,
      ],
      errorExtractors: [
        {
          match: (error) => error instanceof WriteBlockedError,
          extract: (error) => ({
            kind: "passthrough",
            text: (error as WriteBlockedError).message,
          }),
        },
        {
          match: (error) => error instanceof ConfigMissingError,
          extract: (error) => ({
            kind: "passthrough",
            text: (error as ConfigMissingError).message,
          }),
        },
        {
          match: (error) => error instanceof DqStoreError,
          extract: (error) => {
            const err = error as DqStoreError;
            return {
              kind: "structured",
              data: { message: err.message, cause: String(err.cause) },
            };
          },
        },
      ],
    });
Behavior3/5

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

No annotations provided, so description carries full burden. It explains what data is combined but does not disclose side effects or performance implications (e.g., cost of querying 90 days). Adequate but could be richer.

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?

Two sentences, front-loaded with the core value proposition. No wasted words; every part earns its place.

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?

With 2 parameters and no output schema, description adequately explains the composite nature. Lacks details on return format or edge cases, but sufficient for most scenarios. Minor gap for a complex aggregate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50% (only includeFailing has description). Description does not add meaning to the 'days' parameter, which is left undocumented. The tool's purpose hints at 'most recent failing checks' but doesn't clarify how days affects results.

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?

Description clearly states it aggregates score trend, tier compliance, and failing checks, combining three distinct sibling tools. Verb 'aggregates' and explicit listing of components make 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 Guidelines4/5

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

Description implies use when a comprehensive summary is needed by naming the combined tools. Does not explicitly state when not to use or alternatives, but the composite nature provides clear context for selection.

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