Skip to main content
Glama

scan_pipeline_directory

Read-onlyIdempotent

Recursively scan a repository folder of PySpark, SQL, and Databricks notebook files to audit lakehouse quality, compute aggregate health scores, and report per-file findings offline.

Instructions

Recursively scan a local repository or directory of PySpark (.py), SQL (.sql), and Databricks notebook (.ipynb) files to produce an aggregated lakehouse quality audit report.

Usage Guidelines:

  • Use to audit an entire repository, dbt/DLT project, or folder containing multiple pipeline files.

  • For auditing a single Python pipeline script, prefer analyze_pyspark_source.

  • For auditing an isolated SQL query, prefer analyze_sql_source.

Behavior:

  • Recursively inspects the filesystem at directory_path.

  • Completely offline; runs without cloud credentials, JVM, or active cluster connections.

  • Evaluates all supported files, computes individual and aggregate health scores (0-100), and reports per-file findings.

  • Individual file errors are captured inside per-file reports without halting the directory scan.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "directory_path": "<directory_path>"
    },
    "name": "scan_pipeline_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
recursiveNoWhether to scan subdirectories recursively (default: true).
directory_pathYesLocal filesystem path to the pipeline repository or folder.

Output Schema

NameRequiredDescriptionDefault
reportsNoPer-file audit reports.
clean_filesYesNumber of files with zero findings.
flagged_filesYesNumber of files with at least one finding.
overall_scoreYesComposite health score from 0 (worst) to 100 (clean).
target_directoryNoDirectory path that was audited.
total_files_scannedYesTotal pipeline files analyzed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "clean_files": {
      +      "description": "Number of files with zero findings.",
      +      "type": "integer"
      +    },
      +    "flagged_files": {
      +      "description": "Number of files with at least one finding.",
      +      "type": "integer"
      +    },
      +    "overall_score": {
      +      "description": "Composite health score from 0 (worst) to 100 (clean).",
      +      "type": "number"
      +    },
      +    "reports": {
      +      "description": "Per-file audit reports.",
      +      "items": {
      +        "properties": {
      +          "file_path": {
      +            "description": "Relative or absolute path to the file.",
      +            "type": "string"
      +          },
      +          "finding_count": {
      +            "description": "Number of findings in this file.",
      +            "type": "integer"
      +          },
      +          "findings": {
      +            "description": "List of diagnostic findings for this file.",
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "file_path",
      +          "finding_count"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "target_directory": {
      +      "description": "Directory path that was audited.",
      +      "type": "string"
      +    },
      +    "total_files_scanned": {
      +      "description": "Total pipeline files analyzed.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "total_files_scanned",
      +    "clean_files",
      +    "flagged_files",
      +    "overall_score"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations cover readOnly/idempotent/closed-world, but the description adds real value: offline operation requiring no cloud credentials, JVM, or cluster, recursive filesystem inspection, per-file error isolation, and aggregate 0-100 scoring. It stops short of detailing report format or handling of large directories, though output schema may cover returns.

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

Conciseness4/5

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

Well-structured with labeled Usage Guidelines and Behavior sections, front-loaded purpose sentence. Slightly verbose in listing redundancies (e.g., 'without halting the directory scan' after per-file error capture), but every element is scannable.

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

Completeness5/5

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

For a two-param read-only scan with output schema present, the description covers scope, file types, offline constraints, error semantics, and scoring. Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100% with both params documented, so baseline 3. Description adds that directory_path is a local path to a repository or folder and that recursion indeed inspects subdirectories, reinforcing the recursive flag's effect beyond the schema.

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?

Specific verb+resource: recursively scans a local directory for specified file types and produces an aggregated lakehouse quality audit report. It explicitly names two sibling tools (analyze_pyspark_source, analyze_sql_source) and distinguishes scope.

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

Usage Guidelines5/5

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

Explicit when-to-use (entire repo, dbt/DLT project, multi-file folder) and when-not (single file → analyze_pyspark_source, isolated query → analyze_sql_source). Alternatives and selection condition are both named.

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