dbt_ls
Discover and list dbt project resources like models, tests, and sources using JSON or text outputs to understand project structure, identify dependencies, and select resources for operations such as running or testing.
Instructions
List dbt resources. An AI agent should use this tool when it needs to discover available models, tests, sources, and other resources within a dbt project. This helps the agent understand the project structure, identify dependencies, and select specific resources for other operations like running or testing.
Returns:
When output_format is 'json' (default):
- With verbose=False (default): returns a simplified JSON with only name, resource_type, and depends_on.nodes
- With verbose=True: returns a full JSON with all resource details
When output_format is 'name', 'path', or 'selector', returns plain text with the respective format.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
exclude | No | Models to exclude | |
models | No | Specific models to list, using the dbt selection syntax. Note that you probably want to specify your selection here e.g. silver.fact | |
output_format | No | Output format (json, name, path, or selector) | json |
profiles_dir | No | Directory containing the profiles.yml file (defaults to project_dir if not specified) | |
project_dir | No | ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.') | . |
resource_type | No | Type of resource to list (model, test, source, etc.) | |
selector | No | Named selector to use | |
verbose | No | Return full JSON output instead of simplified version |
Input Schema (JSON Schema)
{
"properties": {
"exclude": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Models to exclude",
"title": "Exclude"
},
"models": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Specific models to list, using the dbt selection syntax. Note that you probably want to specify your selection here e.g. silver.fact",
"title": "Models"
},
"output_format": {
"default": "json",
"description": "Output format (json, name, path, or selector)",
"title": "Output Format",
"type": "string"
},
"profiles_dir": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Directory containing the profiles.yml file (defaults to project_dir if not specified)",
"title": "Profiles Dir"
},
"project_dir": {
"default": ".",
"description": "ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.')",
"title": "Project Dir",
"type": "string"
},
"resource_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of resource to list (model, test, source, etc.)",
"title": "Resource Type"
},
"selector": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Named selector to use",
"title": "Selector"
},
"verbose": {
"default": false,
"description": "Return full JSON output instead of simplified version",
"title": "Verbose",
"type": "boolean"
}
},
"title": "dbt_lsArguments",
"type": "object"
}