Skip to main content
Glama

scan_project

Build a pipeline map from an existing project using static AST analysis, detecting data reads/writes, parameters, imports and step links without executing code.

Instructions

Build the map of an EXISTING project by static analysis (ast only; user code is never executed).

Detects data reads/writes, argparse/click params, local imports, docstrings and step kinds, links steps whose output paths match other steps' inputs (falling back to file numbering and imports), and imports existing results as runs tagged 'imported'. Idempotent: re-scans update scanner-owned fields, add new steps, never delete, and keep edits made with add_step. Review the returned summary and fix it with connect_steps / add_step.

Input Schema

NameRequiredDescriptionDefault
pathNoFolder to scan, relative to the project root.
dry_runNoReturn the proposed map without writing anything
excludeNoGlob patterns to skip (default: venvs, .git, tests, __pycache__, .mltree, build dirs)
includeNoGlob patterns to scan (default **/*.py, **/*.ipynb)
import_resultsNoImport existing metrics/MLflow/Optuna/Lightning/wandb results as runs
notebook_sectionsNoMake each markdown-headed notebook section a step

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the safety profile (AST only, user code never executed), mutation semantics (re-scans update scanner-owned fields, add steps, never delete), edit preservation (keeps changes made with add_step), and side effects (imports results as runs tagged 'imported').

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?

Front-loaded with the core purpose and no filler; each subsequent sentence covers detection scope, idempotency, and next steps. The middle sentence is a dense run-on list that could be split for faster scanning.

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?

All six parameters are documented in the schema, an output schema exists so return details needn't be restated, and the description still covers safety, idempotency, and correction workflow. 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%, so parameters are already documented; the description nevertheless adds meaning the schema lacks, notably what import_results produces (runs tagged 'imported'). It does not explain include/exclude interaction or default traversal cost, keeping it below schema-plus-extra depth.

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?

Opens with a specific verb+resource ('Build the map of an EXISTING project') and immediately scopes the mechanism ('by static analysis (ast only; user code is never executed)'). The capitalized EXISTING implicitly separates it from init_project, and the enumerated detections (data reads/writes, CLI params, imports, step kinds) make the output concrete.

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?

Clearly positions the tool in the workflow: run it, then 'fix it with connect_steps / add_step', and explains the idempotent re-scan case. It never explicitly says when NOT to use it (e.g., a brand-new project should use init_project), so exclusions stop short of a 5.

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