No slash command · from datajunction
Queries DataJunction (DJ) to find nodes, generate SQL, fetch metric data, explore lineage, and visualize results via DJ UI, MCP tools, or REST/GraphQL APIs.
Ships in datajunction. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Consumer-side workflow for DJ: find existing nodes, build SQL to query them, fetch data, visualize results. For the underlying concepts (node types, dimension links, star schema), invoke the datajunction skill.
For interactive exploration — browsing namespaces, inspecting a node's lineage / SQL / available dimensions, building queries by clicking dimensions on/off — the DJ web UI is usually the fastest path. It's hosted at the same URL as the DJ server (e.g. https://your-dj-server.example.com/).
Use the UI when:
Use the MCP tools / API (below) when:
Suggest opening the UI when the user's question is exploratory and you don't yet know the right node name. Suggest MCP tools when you have a name in hand and need data, lineage, or generated SQL.
When you need to explore the DJ semantic layer, use these MCP tools:
Use MCP tool: search_nodes
Example: search_nodes(query="revenue", node_type="metric", namespace="finance")
Use MCP tool: get_node_details
Example: get_node_details(name="finance.total_revenue")
What you get:
Use MCP tool: get_common
Example: get_common(metrics=["finance.total_revenue", "growth.daily_active_users"])
When to use: Always check this before building queries with multiple metrics!
Use MCP tool: get_node_lineage
Example: get_node_lineage(node_name="finance.total_revenue", direction="both")
When you need to query metrics or generate SQL, use these MCP tools:
Use MCP tool: build_metric_sql
Example:
build_metric_sql(
metrics=["finance.total_revenue"],
dimensions=["core.date.date"],
filters=["core.date.date >= '2024-01-01'"],
orderby=["core.date.date ASC"],
limit=100,
dialect="trino",
)
Returns:
Performance: always pass a filter on a date/time dimension. When the upstream cube has a temporal partition declared on that dimension, DJ pushes the filter down to the partition column, limiting the data scanned. Without a time filter, queries scan the full underlying table.
(Don't pass include_temporal_filters=True here — that's a parameter on get_query_plan for inspecting partition templates in materialization-plan SQL, not for live queries.)
Use MCP tool: get_metric_data
Example:
get_metric_data(
metrics=["finance.total_revenue", "finance.transaction_count"],
dimensions=["core.date.date", "core.region.region_name"],
filters=["core.date.date >= '2024-01-01'"],
orderby=["core.date.date ASC"],
limit=1000
)
Best practices:
limitget_query_plan
first (see below) — it returns the scan estimate without executingUse MCP tool: visualize_metrics
get_metric_dataExample:
visualize_metrics(
metrics=["finance.total_revenue"],
dimensions=["core.date.date"],
filters=["core.date.date >= '2024-01-01'"],
orderby=["core.date.date ASC"],
limit=90,
chart_type="line"
)
Chart types:
line: Time series (default)bar: Categorical comparisonsscatter: Correlation analysisUse MCP tool: get_query_plan
get_metric_data / visualize_metrics if you suspect
the query might be expensive — the same scan estimate that drives the
refusal guardrail is surfaced here, so you can iterate on filters
until the estimate is reasonableExample:
get_query_plan(
metrics=["finance.total_revenue"],
dimensions=["core.date.date"],
filters=["core.date.date >= '2024-01-01'"],
)
When to use:
The MCP tools call the DJ REST and GraphQL APIs under the hood. Here's what they're doing:
Node discovery:
GET /nodes?node_type=metric&namespace=finance
GET /nodes/{node_name}
SQL generation (⚠️ Always use V3):
GET /sql/metrics/v3 # Generate query SQL
GET /sql/measures/v3 # Generate pre-aggregation SQL
Dimension compatibility:
GET /metrics/common/dimensions
Available at /graphql:
query {
nodes(nodeType: METRIC, namespace: "finance") {
name
description
dimensions { name type }
}
commonDimensions(nodes: ["finance.revenue", "growth.users"]) {
name
type
}
}
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub datajunction/dj --plugin datajunction5 skills in this plugin
/datajunctionActivate this skill whenever working with DataJunction (DJ) semantic layer.
Core concepts and shared vocabulary used by every DJ workflow.
Keywords:
- DataJunction, DJ
- semantic layer
- dimension link, dimension links
- star schema
- node types
- source, transform, dimension, metric, cube
- mode, status, valid, invalid, draft, published
- namespace
/datajunction-apiActivate this skill when authoring DataJunction (DJ) nodes via the REST
API directly (curl, HTTP clients) — typically for exploration, ad-hoc
prototyping, or namespaces that aren't repo-backed.
Keywords:
- DJ API, REST API, curl
- POST nodes/metric, POST nodes/dimension
- create a metric via the API, create a dimension via the API
- create a node with curl
- prototyping, exploration
/Other plugins' skills for the same job