Skip to main content
Glama
dbt-labs
by dbt-labs

get_dimensions

Extract dimensions for specified metrics to categorize and analyze data attributes effectively. Ideal for identifying key characteristics in datasets.

Instructions

Dimensions are the attributes, features, or characteristics that describe or categorize data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricsYes

Implementation Reference

  • Primary MCP tool handler for 'get_dimensions'. This is the function invoked when the tool is called, which delegates to the SemanticLayerFetcher.
    @dbt_mcp_tool(
        description=get_prompt("semantic_layer/get_dimensions"),
        title="Get Dimensions",
        read_only_hint=True,
        destructive_hint=False,
        idempotent_hint=True,
    )
    async def get_dimensions(
        context: SemanticLayerToolContext, metrics: list[str], search: str | None = None
    ) -> list[DimensionToolResponse]:
        return await context.semantic_layer_fetcher.get_dimensions(
            metrics=metrics, search=search
        )
  • Core helper function in SemanticLayerFetcher that performs the actual GraphQL query to fetch dimensions and caches the results.
    async def get_dimensions(
        self, metrics: list[str], search: str | None = None
    ) -> list[DimensionToolResponse]:
        metrics_key = ",".join(sorted(metrics))
        if metrics_key not in self.dimensions_cache:
            dimensions_result = await submit_request(
                await self.config_provider.get_config(),
                {
                    "query": GRAPHQL_QUERIES["dimensions"],
                    "variables": {
                        "metrics": [{"name": m} for m in metrics],
                        "search": search,
                    },
                },
            )
            dimensions = []
            for d in dimensions_result["data"]["dimensionsPaginated"]["items"]:
                dimensions.append(
                    DimensionToolResponse(
                        name=d.get("name"),
                        type=d.get("type"),
                        description=d.get("description"),
                        label=d.get("label"),
                        granularities=d.get("queryableGranularities")
                        + d.get("queryableTimeGranularities"),
                    )
                )
            self.dimensions_cache[metrics_key] = dimensions
        return self.dimensions_cache[metrics_key]
  • Pydantic/dataclass defining the output schema for dimension responses.
    class DimensionToolResponse:
        name: str
        type: DimensionType
        description: str | None = None
        label: str | None = None
        granularities: list[str] | None = None
  • List of semantic layer tools including get_dimensions, used for registration into the MCP server.
    SEMANTIC_LAYER_TOOLS = [
        list_metrics,
        list_saved_queries,
        get_dimensions,
        get_entities,
        query_metrics,
        get_metrics_compiled_sql,
    ]
  • Toolset definition including get_dimensions for enable/disable configuration.
    Toolset.SEMANTIC_LAYER: {
        ToolName.LIST_METRICS,
        ToolName.LIST_SAVED_QUERIES,
        ToolName.GET_DIMENSIONS,
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description states it 'Get the dimensions' which implies a read-only operation, but it doesn't specify whether this requires authentication, what format the output is in, if there are rate limits, or any error conditions. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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?

The description is appropriately sized with clear sectioning using <instructions> and <parameters> tags. The first sentence directly states the purpose, and the explanation of dimensions is helpful context. However, the structure could be more front-loaded with the core purpose, and the parameters section is somewhat redundant with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there are no annotations, no output schema, and low schema description coverage (0%), the description is incomplete. It doesn't explain what the tool returns, how dimensions are structured, or provide any examples. For a tool that presumably returns data about dimensions, the lack of output information is a significant gap, especially with multiple sibling tools that might overlap in functionality.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description includes a parameters section that lists 'metrics: List of metric names', which matches the single parameter in the input schema. However, with 0% schema description coverage, the description doesn't add meaningful semantics beyond what's obvious from the parameter name. It doesn't explain what valid metric names are, provide examples, or describe the relationship between metrics and dimensions. The baseline is 3 since schema coverage is low but the description provides minimal compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get the dimensions for specified metrics' which provides a clear verb ('Get') and resource ('dimensions'), but it's somewhat vague about what dimensions actually are. The explanation 'Dimensions are the attributes, features, or characteristics that describe or categorize data' helps but doesn't make the purpose specific enough to distinguish it from siblings like 'get_entities' or 'list_metrics' without additional context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_entities', 'list_metrics', and 'query_metrics' available, there's no indication of when this tool is appropriate or what distinguishes it from those other options. The only implied usage is when you need dimensions for metrics, but no explicit context or exclusions are provided.

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

Install Server

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