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

dbt-list-tests

List dbt tests, filtered by type (generic/singular), model attachment, or name substring, with configurable result limits.

Instructions

List dbt tests (generic or singular) optionally filtered to a specific model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attachedToNoFilter to tests attached to a specific model unique_id or name
testKindNoall
searchNoSubstring match against test name
limitNo

Implementation Reference

  • src/index.ts:79-79 (registration)
    Registration of the dbt-list-tests tool with schema and handler on the MCP server.
    tool("dbt-list-tests", "List dbt tests (generic or singular) optionally filtered to a specific model", dbtListTestsSchema.shape, wrapToolHandler(dbtListTests));
  • Zod schema for dbt-list-tests input: attachedTo, testKind (default 'all'), search, limit (default 500).
    export const dbtListTestsSchema = z.object({
      attachedTo: z
        .string()
        .optional()
        .describe("Filter to tests attached to a specific model unique_id or name"),
      testKind: z.enum(["generic", "singular", "all"]).default("all"),
      search: z.string().optional().describe("Substring match against test name"),
      limit: z.coerce.number().int().min(1).max(2000).default(500),
    });
  • Handler function dbtListTests: loads manifest, filters test nodes by kind/name/attached model, returns list of tests with metadata.
    export async function dbtListTests(args: z.infer<typeof dbtListTestsSchema>): Promise<unknown> {
      const manifest = loadManifest();
      let attachedId: string | undefined = args.attachedTo;
      if (attachedId && !manifest.nodes[attachedId]) {
        const found = Object.values(manifest.nodes).find((n) => n.name === attachedId);
        attachedId = found?.unique_id;
      }
      const out: Array<Record<string, unknown>> = [];
      const search = args.search?.toLowerCase();
      for (const node of Object.values(manifest.nodes)) {
        if (!isTest(node)) continue;
        const isGeneric = !!node.test_metadata;
        if (args.testKind === "generic" && !isGeneric) continue;
        if (args.testKind === "singular" && isGeneric) continue;
        if (search && !node.name.toLowerCase().includes(search)) continue;
        if (attachedId) {
          const dependsNodes = node.depends_on?.nodes ?? [];
          if (!dependsNodes.includes(attachedId) && node.attached_node !== attachedId) continue;
        }
        out.push({
          uniqueId: node.unique_id,
          name: node.name,
          package: node.package_name,
          kind: isGeneric ? "generic" : "singular",
          definition: node.test_metadata?.name,
          column: node.column_name,
          attachedTo: node.depends_on?.nodes?.[0],
          severity: node.severity,
          tags: node.tags ?? node.config?.tags ?? [],
        });
        if (out.length >= args.limit) break;
      }
      return { count: out.length, tests: out };
    }
  • Helper function isTest() used to filter manifest nodes to test resources.
    function isTest(node: DbtNode): boolean {
      return node.resource_type === "test";
    }
  • Import of dbtListTestsSchema and dbtListTests from src/tools/dbt-tests.ts
    import {
      dbtListTestsSchema, dbtListTests,
      dbtGetTestSchema, dbtGetTest,
    } from "./tools/dbt-tests.js";
Behavior2/5

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

No annotations are provided, and the description fails to disclose behavioral traits like pagination, result limits, or what happens when no tests match. The short description does not compensate for the lack of annotations.

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 that is front-loaded with the verb and resource, conveying the core functionality without unnecessary words.

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?

Given the tool has 4 optional parameters and no output schema or annotations, the description is too brief. It does not explain return format, behavior when limit is reached, or how to effectively use search, leaving significant gaps 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 description adds some meaning by mentioning filtering by model and test kind, which maps to attachedTo and testKind parameters. However, it does not detail the search or limit parameters beyond what the schema already provides. With 50% schema coverage, the description partially compensates but is not comprehensive.

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 identifies the tool's action ('list dbt tests') and distinguishes between generic and singular tests, with optional filtering to a specific model. This is specific and differentiates from siblings like dbt-get-test or dbt-failed-tests.

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 does not indicate when to use this tool versus alternatives such as dbt-failed-tests or dbt-get-test. There is no mention of prerequisites or exclusions, leaving usage context entirely to the agent's inference.

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