dbt_seed
Load CSV files as seed data to create reference tables, test datasets, or static data for database models.
Instructions
Load CSV files as seed data. An AI agent should use this tool when it needs to load initial data from CSV files into the database. This is essential for creating reference tables, test datasets, or any static data that models will depend on.
Returns:
Output from the dbt seed command as text (this command does not support JSON output format)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | No | Named selector to use | |
| exclude | No | Seeds to exclude | |
| project_dir | No | ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.') | . |
| profiles_dir | No | Directory containing the profiles.yml file (defaults to project_dir if not specified) |
Implementation Reference
- src/tools.py:311-350 (handler)The primary MCP tool handler for 'dbt_seed'. Defines input schema via Pydantic Fields and implements the logic to execute 'dbt seed' command with optional selector and exclude parameters.@mcp.tool() async def dbt_seed( selector: Optional[str] = Field( default=None, description="Named selector to use" ), exclude: Optional[str] = Field( default=None, description="Seeds to exclude" ), project_dir: str = Field( default=".", description="ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.')" ), profiles_dir: Optional[str] = Field( default=None, description="Directory containing the profiles.yml file (defaults to project_dir if not specified)" ) ) -> str: """Load CSV files as seed data. An AI agent should use this tool when it needs to load initial data from CSV files into the database. This is essential for creating reference tables, test datasets, or any static data that models will depend on. Returns: Output from the dbt seed command as text (this command does not support JSON output format) """ command = ["seed"] # The --no-print flag is not supported by dbt Cloud CLI # We'll rely on proper parsing to handle any print macros if selector: command.extend(["--selector", selector]) if exclude: command.extend(["--exclude", exclude]) result = await execute_dbt_command(command, project_dir, profiles_dir) # Use the centralized result processor return await process_command_result(result, command_name="seed")
- src/server.py:89-89 (registration)Registers all MCP tools, including 'dbt_seed', by calling register_tools on the FastMCP server instance.register_tools(mcp)
- src/tools.py:25-25 (registration)The register_tools function that defines and registers the 'dbt_seed' tool using @mcp.tool() decorator.def register_tools(mcp: FastMCP) -> None: