Skip to main content
Glama

get_mart_models

Retrieve names and descriptions of mart models in the dbt project environment, organizing cleaned and transformed data for end-user consumption by analysts, dashboards, or business tools.

Instructions

Get the name and description of all mart models in the environment. A mart model is part of the presentation layer of the dbt project. It's where cleaned, transformed data is organized for consumption by end-users, like analysts, dashboards, or business tools.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "title": "get_mart_modelsArguments", "type": "object" }

Implementation Reference

  • The core implementation of the get_mart_models tool handler. It uses the ModelsFetcher to retrieve models filtered by 'marts' layer and excludes the metricflow_time_spine model.
    @dbt_mcp_tool( description=get_prompt("discovery/get_mart_models"), title="Get Mart Models", read_only_hint=True, destructive_hint=False, idempotent_hint=True, ) async def get_mart_models(context: DiscoveryToolContext) -> list[dict]: mart_models = await context.models_fetcher.fetch_models( model_filter={"modelingLayer": "marts"} ) return [m for m in mart_models if m["name"] != "metricflow_time_spine"]
  • The registration call to register_discovery_tools on the MCP server, which includes the get_mart_models tool among discovery tools.
    logger.info("Registering discovery tools") register_discovery_tools( dbt_mcp, config.discovery_config_provider, disabled_tools=disabled_tools, enabled_tools=enabled_tools, enabled_toolsets=enabled_toolsets, disabled_toolsets=disabled_toolsets, )
  • The DISCOVERY_TOOLS list that includes the get_mart_models function for registration via register_discovery_tools.
    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, ]
  • Definition of the ToolName enum member for get_mart_models, used in registration, policies, and toolsets.
    GET_MART_MODELS = "get_mart_models" GET_ALL_MODELS = "get_all_models"
  • Inclusion of get_mart_models in the DISCOVERY toolset, allowing toolset-level enable/disable.
    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, },

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