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

dbt-list-macros

List dbt macros from manifest.json using filters for package or macro name to find relevant macros quickly.

Instructions

List dbt macros from manifest.json with package / name filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNoFilter by package name
searchNoSubstring match against macro name
limitNo

Implementation Reference

  • Handler function for dbt-list-macros. Loads the manifest, iterates over macros, applies optional package/name filters and a limit, then returns matching macros with their metadata.
    export async function dbtListMacros(args: z.infer<typeof dbtListMacrosSchema>): Promise<unknown> {
      const manifest = loadManifest();
      const out: Array<Record<string, unknown>> = [];
      const search = args.search?.toLowerCase();
      for (const m of Object.values(manifest.macros)) {
        if (args.package && m.package_name !== args.package) continue;
        if (search && !m.name.toLowerCase().includes(search)) continue;
        out.push({
          uniqueId: m.unique_id,
          name: m.name,
          package: m.package_name,
          path: m.original_file_path,
          arguments: m.arguments?.map((a) => ({ name: a.name, type: a.type })) ?? [],
          description: m.description,
        });
        if (out.length >= args.limit) break;
      }
      return { count: out.length, macros: out };
    }
  • Zod schema defining the input parameters for dbt-list-macros: package filter, search substring, and limit (default 500).
    export const dbtListMacrosSchema = z.object({
      package: z.string().optional().describe("Filter by package name"),
      search: z.string().optional().describe("Substring match against macro name"),
      limit: z.coerce.number().int().min(1).max(2000).default(500),
    });
  • src/index.ts:84-85 (registration)
    Registration of the dbt-list-macros tool in the MCP server, linking the schema and handler.
    tool("dbt-list-macros", "List dbt macros from manifest.json with package / name filters", dbtListMacrosSchema.shape, wrapToolHandler(dbtListMacros));
    tool("dbt-get-macro", "Get a dbt macro: signature, raw SQL, and reverse-lookup of nodes that call it", dbtGetMacroSchema.shape, wrapToolHandler(dbtGetMacro));
Behavior2/5

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

With no annotations, the description should disclose behavioral traits. It only states the basic operation without mentioning read-only nature, potential errors if manifest.json is missing, or any performance implications. The agent has limited insight into side effects.

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 front-loads the key action and resource. It is concise with no extraneous information.

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?

The tool has no output schema and the description does not specify return format or what fields are included. For a list operation, this leaves the agent guessing about the response structure.

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 value by summarizing the package and search parameters as filters, but does not elaborate on the limit parameter beyond what the schema provides. Schema coverage is 67%; the description partially compensates but is not fully informative.

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 action (list), the resource (dbt macros), the source (manifest.json), and the filters (package/name). This distinguishes it from sibling list tools that target other resources (models, sources, etc.) and from dbt-get-macro which retrieves a single macro.

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 like dbt-get-macro for single macro retrieval or other list tools. No when-to-use or when-not-to-use context is given.

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