Skip to main content
Glama

get_all_models

Retrieve names and descriptions of all dbt models in your environment for comprehensive analysis and management.

Instructions

Get the name and description of all dbt models in the environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get_all_models' tool. It is decorated with @dbt_mcp_tool which defines its metadata, description, and hints. The function fetches all models using the provided ModelsFetcher.
    @dbt_mcp_tool( description=get_prompt("discovery/get_all_models"), title="Get All Models", read_only_hint=True, destructive_hint=False, idempotent_hint=True, ) async def get_all_models(context: DiscoveryToolContext) -> list[dict]: return await context.models_fetcher.fetch_models()
  • Registration of the discovery tools including get_all_models. The DISCOVERY_TOOLS list includes the handler, and register_discovery_tools binds the context and calls register_tools to add them to the FastMCP server.
    DISCOVERY_TOOLS = [ get_mart_models, get_all_models, get_model_details, get_model_parents, get_model_children, get_model_health, get_exposures, get_exposure_details, get_all_sources, get_source_details, get_macro_details, get_seed_details, get_semantic_model_details, get_snapshot_details, get_test_details, ] def register_discovery_tools( dbt_mcp: FastMCP, discovery_config_provider: ConfigProvider[DiscoveryConfig], *, disabled_tools: set[ToolName], enabled_tools: set[ToolName], enabled_toolsets: set[Toolset], disabled_toolsets: set[Toolset], ) -> None: def bind_context() -> DiscoveryToolContext: return DiscoveryToolContext(config_provider=discovery_config_provider) register_tools( dbt_mcp, tool_definitions=[tool.adapt_context(bind_context) for tool in DISCOVERY_TOOLS], disabled_tools=disabled_tools, enabled_tools=enabled_tools, enabled_toolsets=enabled_toolsets, disabled_toolsets=disabled_toolsets, )
  • Enum definition for the tool name 'get_all_models' used throughout the codebase for references.
    GET_ALL_MODELS = "get_all_models"
  • The get_all_models tool is mapped to the 'discovery' toolset, enabling toolset-level control.
    Toolset.DISCOVERY: { ToolName.GET_MART_MODELS, ToolName.GET_ALL_MODELS, ToolName.GET_MODEL_DETAILS, ToolName.GET_MODEL_PARENTS, ToolName.GET_MODEL_CHILDREN, ToolName.GET_MODEL_HEALTH, ToolName.GET_ALL_SOURCES, ToolName.GET_SOURCE_DETAILS, ToolName.GET_EXPOSURES, ToolName.GET_EXPOSURE_DETAILS, ToolName.GET_RELATED_MODELS, ToolName.GET_MACRO_DETAILS, ToolName.GET_SEED_DETAILS, ToolName.GET_SEMANTIC_MODEL_DETAILS, ToolName.GET_SNAPSHOT_DETAILS, ToolName.GET_TEST_DETAILS, },
  • Policy definition for the get_all_models tool, classifying it as METADATA behavior.
    ToolName.GET_ALL_MODELS.value: ToolPolicy( name=ToolName.GET_ALL_MODELS.value, behavior=ToolBehavior.METADATA ),

Other Tools

Related 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/dbt-labs/dbt-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server