LeaderboardBack to leaderboard — loading return destination
Opening report…
Loading report overview
M
MCP server
server.example.com/mcp
Tools and resources for your MCP client, with a public quality report and detailed checks.
Protocol
MCP 2025-11-25
Server version
1.0.0
Website
server.example.com
Supports
Tools · Resources
Overall score
90 /100
How is this score calculated?
Server metadata
Loading server metadata
Reviewed90/100
Discoverability
Loading discoverability
Reviewed90/100
Protocol
Loading protocol
Reviewed90/100
Tools
Loading tools
Reviewed90/100
MCP Apps
Loading mcp apps
Reviewed90/100
Tool documentation quality
Loading tool documentation quality
Reviewed90/100
LeaderboardBack to leaderboard — loading return destination
Verified by the Motley team. This team proved they run the server, with an email on its domain or by deploying it on Manufact. It says who runs it, not that Manufact vouches for it.
Motley is a semantic layer over your data: query models, measures, dimensions and filters instead of SQL. Start with inspect(reference='memory:help.intro', entity_type='memory') for concepts and help topics. Workflow: search → inspect → query. Data sources are managed for you. With a GitHub config repo, model and memory edits land on your active branch (list_resources(what='branches'), switch_branch). If the data cannot answer reliably, say so rather than guess.
Discoverability
0 pass · 1 partial0 passed · 1 partial8/100
Client listings and public setup information.
MCP Server Card
An MCP Server Card found through ai-catalog.json or the endpoint's /server-card that declares this endpoint passes. Earlier paths and mcp.json earn half credit.
No MCP Server Card declares this endpoint, at its /server-card URL, in /.well-known/ai-catalog.json, or at a fallback path. Expected at https://app.motley.ai/api/v1/mcp-directory/server-card.
The title clearly communicates the tool’s action and subject. Keep it concise.
Description74/100
Create a new model. Two mutually-exclusive modes: (1) query-backed — pass ``query`` (a SlayerQuery dict, or a list of stage dicts for a multi-stage DAG) and columns are auto-derived from the query; or (2) table-backed — pass ``sql_table`` or ``sql`` (with the source selector) plus explicit ``columns`` / ``measures``.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs89/100
Input documentation gives an agent enough context to populate the arguments.
source_id
ID of the source to target. Optional when the workspace has a single source.
Clear enough to supply this argument.
source_name
Display name of the source (alternative to source_id). If several sources share a name, use source_id.
Clear enough to supply this argument.
data_source
Internal SLayer datasource name (advanced; alternative to source_id/source_name).
Clear enough to supply this argument.
name
Name for the new model (unique within the source).
Measure specs (table mode): each ``{name, formula, type?, description?}``.
Clear enough to supply this argument.
query
Query-backed mode. A single SlayerQuery object — e.g. ``{"source_model": "orders", "measures": ["*:count"], "dimensions": ["status"]}`` — or a list of such stage objects for a multi-stage DAG (last = root). The ``{"subqueries": [...]}`` wrapper that ``query`` takes is also accepted and unwrapped.
Clear enough to supply this argument.
variables
Default variable values for a query-backed model.
Clear enough to supply this argument.
access_tags
Access groups: only users sharing one see the model; untagged models are visible to all. Names are lowercase letters, digits, '_' or '-'.
Clear enough to supply this argument.
replace
Allow overwriting an existing model of the same name. Without this, creating over an existing model is rejected.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "create_model",
"title": "Create Model",
"description": "Create a new model. Two mutually-exclusive modes: (1) query-backed — pass ``query`` (a SlayerQuery dict, or a list of stage dicts for a multi-stage DAG) and columns are auto-derived from the query; or (2) table-backed — pass ``sql_table`` or ``sql`` (with the source selector) plus explicit ``columns`` / ``measures``.",
"inputSchema": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string",
"description": "SQL SELECT to back the model (table mode)."
},
"name": {
"type": "string",
"description": "Name for the new model (unique within the source)."
},
"query": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
{
"type": "null"
}
],
"description": "Query-backed mode. A single SlayerQuery object — e.g. ``{\"source_model\": \"orders\", \"measures\": [\"*:count\"], \"dimensions\": [\"status\"]}`` — or a list of such stage objects for a multi-stage DAG (last = root). The ``{\"subqueries\": [...]}`` wrapper that ``query`` takes is also accepted and unwrapped."
},
"columns": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Column specs (table mode): each ``{name, sql?, type?, primary_key?, description?, ...}``."
},
"replace": {
"type": "boolean",
"description": "Allow overwriting an existing model of the same name. Without this, creating over an existing model is rejected."
},
"measures": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Measure specs (table mode): each ``{name, formula, type?, description?}``."
},
"source_id": {
"type": "string",
"format": "uuid",
"description": "ID of the source to target. Optional when the workspace has a single source."
},
"sql_table": {
"type": "string",
"description": "Table name to back the model (table mode)."
},
"variables": {
"type": "object",
"description": "Default variable values for a query-backed model.",
"additionalProperties": true
},
"access_tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Access groups: only users sharing one see the model; untagged models are visible to all. Names are lowercase letters, digits, '_' or '-'."
},
"data_source": {
"type": "string",
"description": "Internal SLayer datasource name (advanced; alternative to source_id/source_name)."
},
"description": {
"type": "string",
"description": "Human-readable model description."
},
"source_name": {
"type": "string",
"description": "Display name of the source (alternative to source_id). If several sources share a name, use source_id."
}
}
},
"annotations": {
"title": "Create Model",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description92/100
Edit an existing model in one atomic transaction — upsert columns/measures/aggregations/joins, remove entities, add/remove model-level filters, and set metadata. Every change is validated against the final model state and persisted in a single write: if any change is invalid, none are applied. Upserts and removals are keyed by ``name``; a join by its edge ``name``, else by a ``target_model`` it alone joins. Use the inherited source selector only to disambiguate the model when its name is not unique across sources.
The description explains the capability, when to use it, and what to expect.
Inputs82/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
source_id
ID of the source to target. Optional when the workspace has a single source.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
source_name
Display name of the source (alternative to source_id). If several sources share a name, use source_id.
Clear enough to supply this argument.
data_source
Internal SLayer datasource name (advanced; alternative to source_id/source_name).
Explain the meaning of this value, not just its name.
model_name
Name of the model to edit.
Clear enough to supply this argument.
description
New model description.
Explain the meaning of this value, not just its name.
default_time_dimension
Name of the column to use as the default time dimension.
Explain what happens when this optional value is omitted.
hidden
Hide/unhide the model.
Clear enough to supply this argument.
access_tags
Replace the model's access groups; ``[]`` makes it visible to every user.
Clear enough to supply this argument.
meta
Replace the model's free-form ``meta`` dict.
Explain the meaning of this value, not just its name.
new_source_id
Move the model to this source (by id).
Clear enough to supply this argument.
new_source_name
Move the model to this source (by display name).
Clear enough to supply this argument.
columns
Column specs to upsert (by ``name``); partial updates merge.
Clear enough to supply this argument.
measures
Measure specs to upsert (by ``name``); partial updates merge.
Clear enough to supply this argument.
aggregations
Aggregation specs to upsert (by ``name``); partial updates merge.
Clear enough to supply this argument.
joins
Join specs to upsert; partial updates merge. Matched by edge ``name``, else by ``target_model`` plus identical ``join_pairs``, else the sole join to ``target_model``. A second join to a target needs a ``name``.
Clear enough to supply this argument.
remove
Entities to remove, keyed by ``columns``/``measures``/``aggregations``/``joins``. A join is named by its edge name, or by its target_model when only one join reaches it.
Clear enough to supply this argument.
add_filters
Model-level filter predicates to add.
Clear enough to supply this argument.
remove_filters
Model-level filter predicates to remove (exact match).
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "edit_model",
"title": "Edit Model",
"description": "Edit an existing model in one atomic transaction — upsert columns/measures/aggregations/joins, remove entities, add/remove model-level filters, and set metadata. Every change is validated against the final model state and persisted in a single write: if any change is invalid, none are applied. Upserts and removals are keyed by ``name``; a join by its edge ``name``, else by a ``target_model`` it alone joins. Use the inherited source selector only to disambiguate the model when its name is not unique across sources.",
"inputSchema": {
"type": "object",
"required": [
"model_name"
],
"properties": {
"meta": {
"type": "object",
"description": "Replace the model's free-form ``meta`` dict.",
"additionalProperties": true
},
"joins": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Join specs to upsert; partial updates merge. Matched by edge ``name``, else by ``target_model`` plus identical ``join_pairs``, else the sole join to ``target_model``. A second join to a target needs a ``name``."
},
"hidden": {
"type": "boolean",
"description": "Hide/unhide the model."
},
"remove": {
"type": "object",
"description": "Entities to remove, keyed by ``columns``/``measures``/``aggregations``/``joins``. A join is named by its edge name, or by its target_model when only one join reaches it.",
"additionalProperties": true
},
"columns": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Column specs to upsert (by ``name``); partial updates merge."
},
"measures": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Measure specs to upsert (by ``name``); partial updates merge."
},
"source_id": {
"type": "string",
"format": "uuid",
"description": "ID of the source to target. Optional when the workspace has a single source."
},
"model_name": {
"type": "string",
"description": "Name of the model to edit."
},
"access_tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Replace the model's access groups; ``[]`` makes it visible to every user."
},
"add_filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Model-level filter predicates to add."
},
"data_source": {
"type": "string",
"description": "Internal SLayer datasource name (advanced; alternative to source_id/source_name)."
},
"description": {
"type": "string",
"description": "New model description."
},
"source_name": {
"type": "string",
"description": "Display name of the source (alternative to source_id). If several sources share a name, use source_id."
},
"aggregations": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Aggregation specs to upsert (by ``name``); partial updates merge."
},
"new_source_id": {
"type": "string",
"format": "uuid",
"description": "Move the model to this source (by id)."
},
"remove_filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Model-level filter predicates to remove (exact match)."
},
"new_source_name": {
"type": "string",
"description": "Move the model to this source (by display name)."
},
"default_time_dimension": {
"type": "string",
"description": "Name of the column to use as the default time dimension."
}
}
},
"annotations": {
"title": "Edit Model",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description86/100
Delete an entity. ``entity_type`` selects what and ``reference`` identifies it: a model name for ``model``; ``memory:<id>`` (or ``<id>``) for ``memory``; ``model.<name>`` for a ``column`` / ``measure`` / ``aggregation``, and ``model.<edge name>`` for a ``join`` (or ``model.<target_model>`` when only one join reaches that target). Deleting a sub-entity that a surviving entity depends on fails validation. Use the source selector to disambiguate the model when its name is not unique across sources.
The description explains the capability, when to use it, and what to expect.
Inputs80/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
source_id
ID of the source to target. Optional when the workspace has a single source.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
source_name
Display name of the source (alternative to source_id). If several sources share a name, use source_id.
Clear enough to supply this argument.
data_source
Internal SLayer datasource name (advanced; alternative to source_id/source_name).
Explain the meaning of this value, not just its name.
entity_type
What kind of entity to delete.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
reference
Identifier: model name, ``memory:<id>``, or ``model.<name>`` for a sub-entity.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "delete",
"title": "Delete Entity",
"description": "Delete an entity. ``entity_type`` selects what and ``reference`` identifies it: a model name for ``model``; ``memory:<id>`` (or ``<id>``) for ``memory``; ``model.<name>`` for a ``column`` / ``measure`` / ``aggregation``, and ``model.<edge name>`` for a ``join`` (or ``model.<target_model>`` when only one join reaches that target). Deleting a sub-entity that a surviving entity depends on fails validation. Use the source selector to disambiguate the model when its name is not unique across sources.",
"inputSchema": {
"type": "object",
"required": [
"entity_type",
"reference"
],
"properties": {
"reference": {
"type": "string",
"description": "Identifier: model name, ``memory:<id>``, or ``model.<name>`` for a sub-entity."
},
"source_id": {
"type": "string",
"format": "uuid",
"description": "ID of the source to target. Optional when the workspace has a single source."
},
"data_source": {
"type": "string",
"description": "Internal SLayer datasource name (advanced; alternative to source_id/source_name)."
},
"entity_type": {
"enum": [
"model",
"memory",
"column",
"measure",
"aggregation",
"join"
],
"type": "string",
"description": "What kind of entity to delete."
},
"source_name": {
"type": "string",
"description": "Display name of the source (alternative to source_id). If several sources share a name, use source_id."
}
}
},
"annotations": {
"title": "Delete Entity",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description81/100
Inspect an entity, or list a collection. ``reference`` is a bare ``model`` or ``model.leaf`` for a model/column/measure/aggregation (scope the source with the selector if the name is not unique); the source's display name for a ``datasource``; or ``memory:<id>`` (e.g. ``memory:help.intro``) for a ``memory``. Omit ``reference`` to list a collection — all models (``model``) or all sources (``datasource``).
The description explains the capability, when to use it, and what to expect.
Inputs84/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
source_id
ID of the source to target. Optional when the workspace has a single source.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
source_name
Display name of the source (alternative to source_id). If several sources share a name, use source_id.
Clear enough to supply this argument.
data_source
Internal SLayer datasource name (advanced; alternative to source_id/source_name).
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
entity_type
What kind of entity to inspect.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
reference
Identifier (see the tool description); omit to list a collection.
Clear enough to supply this argument.
compact
Compact output (descriptions only, no sampled text).
Clear enough to supply this argument.
num_rows
Sample rows to include for a model (0 = none; any value > 0 switches to the full view).
Clear enough to supply this argument.
show_sql
Include the backing SQL/table definition (switches to the full view).
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "inspect",
"title": "Inspect Entity",
"description": "Inspect an entity, or list a collection. ``reference`` is a bare ``model`` or ``model.leaf`` for a model/column/measure/aggregation (scope the source with the selector if the name is not unique); the source's display name for a ``datasource``; or ``memory:<id>`` (e.g. ``memory:help.intro``) for a ``memory``. Omit ``reference`` to list a collection — all models (``model``) or all sources (``datasource``).",
"inputSchema": {
"type": "object",
"required": [
"entity_type"
],
"properties": {
"compact": {
"type": "boolean",
"description": "Compact output (descriptions only, no sampled text)."
},
"num_rows": {
"type": "integer",
"description": "Sample rows to include for a model (0 = none; any value > 0 switches to the full view)."
},
"show_sql": {
"type": "boolean",
"description": "Include the backing SQL/table definition (switches to the full view)."
},
"reference": {
"type": "string",
"description": "Identifier (see the tool description); omit to list a collection."
},
"source_id": {
"type": "string",
"format": "uuid",
"description": "ID of the source to target. Optional when the workspace has a single source."
},
"data_source": {
"type": "string",
"description": "Internal SLayer datasource name (advanced; alternative to source_id/source_name)."
},
"entity_type": {
"enum": [
"datasource",
"model",
"column",
"measure",
"aggregation",
"memory"
],
"type": "string",
"description": "What kind of entity to inspect."
},
"source_name": {
"type": "string",
"description": "Display name of the source (alternative to source_id). If several sources share a name, use source_id."
}
}
},
"annotations": {
"title": "Inspect Entity",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description97/100
Execute a SLayer query and return the raw rows. Results are NOT
persisted. Use it to answer questions and to sanity-check the data (e.g.
"what's the max date in this column?", "how many distinct categories?",
"rough monthly revenue total"). For data-extent / max-time-dim lookups, run
with ``measures=["<time_col>:min", "<time_col>:max", "*:count"]`` and no
dimensions. Variable placeholders ``{name}`` in filters are resolved from
the optional ``variables`` argument. MCP clients often truncate or spill
responses beyond roughly 1,000 rows, so aggregate server-side rather than
pulling raw rows. Read any ``warnings`` in the response before you use the
rows: a broadcast warning means a measure repeats the same value across a
dimension it cannot be split by.
The description explains the capability, when to use it, and what to expect.
Inputs37/100
74 of 160 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
query › anyOf › 0 › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › offset
Rows to skip.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › distinct_dimension_values
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Clear enough to supply this argument.
query › anyOf › 1 › items › offset
Rows to skip.
Clear enough to supply this argument.
query › anyOf › 1 › items › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Clear enough to supply this argument.
query › anyOf › 1 › items › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Clear enough to supply this argument.
variables
Optional name→value bindings used to resolve `{variable}` placeholders in filters and date expressions. ISO date strings are accepted.
Clear enough to supply this argument.
limit
Maximum number of rows to return. Defaults to the main subquery's `limit` when set, else 100.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
show_sql
Include the compiled SQL in the response alongside the rows.
Clear enough to supply this argument.
dry_run
Compile to SQL and return it without executing (no rows).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
explain
Run EXPLAIN ANALYZE and return the query plan instead of rows.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "query",
"title": "Run Query",
"description": "Execute a SLayer query and return the raw rows. Results are NOT\n persisted. Use it to answer questions and to sanity-check the data (e.g.\n \"what's the max date in this column?\", \"how many distinct categories?\",\n \"rough monthly revenue total\"). For data-extent / max-time-dim lookups, run\n with ``measures=[\"<time_col>:min\", \"<time_col>:max\", \"*:count\"]`` and no\n dimensions. Variable placeholders ``{name}`` in filters are resolved from\n the optional ``variables`` argument. MCP clients often truncate or spill\n responses beyond roughly 1,000 rows, so aggregate server-side rather than\n pulling raw rows. Read any ``warnings`` in the response before you use the\n rows: a broadcast warning means a measure repeats the same value across a\n dimension it cannot be split by.",
"inputSchema": {
"type": "object",
"required": [
"query"
],
"properties": {
"limit": {
"type": "integer",
"description": "Maximum number of rows to return. Defaults to the main subquery's `limit` when set, else 100."
},
"query": {
"anyOf": [
{
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "One subquery of a :class:`SlayerFormatQuery`.\n\nInherits slayer ``SlayerQuery``'s ``extra=\"forbid\"`` and every field\ndescription; overrides only ``source_model`` (required, no inline full\nmodel) and ``variables`` (typed with :data:`SlayerVariableValue`).",
"additionalProperties": false
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "One subquery of a :class:`SlayerFormatQuery`.\n\nInherits slayer ``SlayerQuery``'s ``extra=\"forbid\"`` and every field\ndescription; overrides only ``source_model`` (required, no inline full\nmodel) and ``variables`` (typed with :data:`SlayerVariableValue`).",
"additionalProperties": false
},
"minItems": 1
}
],
"description": "A slayer-native query: a single SlayerQuery object, or a list of them (a multi-stage DAG whose LAST entry is the root). Each has `source_model` (a stored model name, or a ModelExtension), and `measures` / `dimensions` / `filters` as SLayer DSL strings (e.g. `'revenue:sum'`, `'*:count'`, `\"status == 'completed'\"`), plus `time_dimensions`, `order`, `limit`. Express a date range as an ordinary filter with `{start_date}` / `{end_date}` placeholders (e.g. `\"created_at >= '{start_date}'\"`). For period-over-period comparison, add a measure with a `time_shift(...)` formula (e.g. `time_shift(revenue:sum, -1, 'year')`)."
},
"format": {
"enum": [
"json",
"markdown",
"csv"
],
"type": "string",
"description": "Output format for the returned rows."
},
"dry_run": {
"type": "boolean",
"description": "Compile to SQL and return it without executing (no rows)."
},
"explain": {
"type": "boolean",
"description": "Run EXPLAIN ANALYZE and return the query plan instead of rows."
},
"show_sql": {
"type": "boolean",
"description": "Include the compiled SQL in the response alongside the rows."
},
"variables": {
"type": "object",
"description": "Optional name→value bindings used to resolve `{variable}` placeholders in filters and date expressions. ISO date strings are accepted.",
"additionalProperties": true
}
}
},
"annotations": {
"title": "Run Query",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description97/100
Search the semantic layer and your saved memories in one call. Returns
a ranked, flat list of hits: models, columns, measures, and memories
(notes you or another agent saved earlier, some carrying an example
query). Call this BEFORE authoring a query against unfamiliar data —
a memory may already record the gotcha (units, filters, which column
actually means "revenue"). Pass ``entities`` when you know what you're
looking at (e.g. ``["orders", "orders.total"]``), ``question`` for
free-text ("how do we compute churn?"), or both. With neither, returns
the most recently saved memories.
The description explains the capability, when to use it, and what to expect.
Inputs36/100
71 of 157 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
entities
Entity references to anchor the search: model names, `model.column` paths, or `memory:<id>`. Aggregation suffixes like `:sum` are accepted and stripped.
Clear enough to supply this argument.
question
Free-text question to rank hits against.
Clear enough to supply this argument.
query › anyOf › 0 › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › offset
Rows to skip.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › distinct_dimension_values
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Clear enough to supply this argument.
query › anyOf › 1 › items › offset
Rows to skip.
Clear enough to supply this argument.
query › anyOf › 1 › items › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Clear enough to supply this argument.
max_results
Maximum number of hits to return.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "search",
"title": "Search Semantic Layer",
"description": "Search the semantic layer and your saved memories in one call. Returns\n a ranked, flat list of hits: models, columns, measures, and memories\n (notes you or another agent saved earlier, some carrying an example\n query). Call this BEFORE authoring a query against unfamiliar data —\n a memory may already record the gotcha (units, filters, which column\n actually means \"revenue\"). Pass ``entities`` when you know what you're\n looking at (e.g. ``[\"orders\", \"orders.total\"]``), ``question`` for\n free-text (\"how do we compute churn?\"), or both. With neither, returns\n the most recently saved memories.",
"inputSchema": {
"type": "object",
"required": [],
"properties": {
"query": {
"anyOf": [
{
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "One subquery of a :class:`SlayerFormatQuery`.\n\nInherits slayer ``SlayerQuery``'s ``extra=\"forbid\"`` and every field\ndescription; overrides only ``source_model`` (required, no inline full\nmodel) and ``variables`` (typed with :data:`SlayerVariableValue`).",
"additionalProperties": false
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "One subquery of a :class:`SlayerFormatQuery`.\n\nInherits slayer ``SlayerQuery``'s ``extra=\"forbid\"`` and every field\ndescription; overrides only ``source_model`` (required, no inline full\nmodel) and ``variables`` (typed with :data:`SlayerVariableValue`).",
"additionalProperties": false
},
"minItems": 1
},
{
"type": "null"
}
],
"description": "Optional example query (same shape as ``query``) whose referenced models/columns/measures seed the search — useful to surface memories relevant to a query you are about to author."
},
"entities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Entity references to anchor the search: model names, `model.column` paths, or `memory:<id>`. Aggregation suffixes like `:sum` are accepted and stripped."
},
"question": {
"type": "string",
"description": "Free-text question to rank hits against."
},
"max_results": {
"type": "integer",
"description": "Maximum number of hits to return."
}
}
},
"annotations": {
"title": "Search Semantic Layer",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description84/100
Save a durable note about the data so future sessions don't rediscover
it. Use for things the schema cannot express: units and conventions
("orders.total is in cents"), definitions ("active user = event in last
28d"), caveats ("refunds are negative rows, filter them for revenue"),
or a known-good example query. The note is indexed under the entities it
mentions and resurfaces via ``search``. Pass ``query`` to attach a
worked example. Re-using an existing ``id`` overwrites that memory.
The description explains the capability, when to use it, and what to expect.
Inputs43/100
38 of 81 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
learning
The note itself. Write it for a reader who lacks this session's context.
Clear enough to supply this argument.
linked_entities
Entities the note is about: model names, `model.column` paths, or `memory:<id>`. Give this or `query`, not both.
Clear enough to supply this argument.
query › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Clear enough to supply this argument.
query › source_model › anyOf › 1 › source_name
Not provided
Missing description. Explain what this value means and how to supply it.
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Missing description. Explain what this value means and how to supply it.
query › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Clear enough to supply this argument.
query › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › variables › additionalProperties › anyOf › 0 › oneOf › 2 › right › type
Discriminator tag for the delta node. Always 'delta'.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › variables › additionalProperties › anyOf › 0 › oneOf › 2 › right › unit
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › variables › additionalProperties › anyOf › 0 › oneOf › 2 › right › value
Non-negative count of `unit`. Sign is carried on the operator.
Missing description. Explain what this value means and how to supply it.
query › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Clear enough to supply this argument.
query › offset
Rows to skip.
Clear enough to supply this argument.
query › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › distinct_dimension_values
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Clear enough to supply this argument.
query › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Clear enough to supply this argument.
id
Optional stable id. Omit to auto-assign. Re-using an id overwrites that memory in place.
Clear enough to supply this argument.
description
Optional one-line preview shown in search results.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "save_memory",
"title": "Save Memory",
"description": "Save a durable note about the data so future sessions don't rediscover\n it. Use for things the schema cannot express: units and conventions\n (\"orders.total is in cents\"), definitions (\"active user = event in last\n 28d\"), caveats (\"refunds are negative rows, filter them for revenue\"),\n or a known-good example query. The note is indexed under the entities it\n mentions and resurfaces via ``search``. Pass ``query`` to attach a\n worked example. Re-using an existing ``id`` overwrites that memory.",
"inputSchema": {
"type": "object",
"required": [
"learning"
],
"properties": {
"id": {
"type": "string",
"description": "Optional stable id. Omit to auto-assign. Re-using an id overwrites that memory in place."
},
"query": {
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "Example query to attach; its entities become the note's links, so do not also pass `linked_entities`. Same shape as one subquery of ``query``: `source_model`, `measures`, `dimensions`, `filters`.",
"additionalProperties": false
},
"learning": {
"type": "string",
"description": "The note itself. Write it for a reader who lacks this session's context."
},
"description": {
"type": "string",
"description": "Optional one-line preview shown in search results."
},
"linked_entities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Entities the note is about: model names, `model.column` paths, or `memory:<id>`. Give this or `query`, not both."
}
}
},
"annotations": {
"title": "Save Memory",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description91/100
Switch the git config branch that your model and memory edits land on. Requires a connected config repo. The choice is per user and shared with the app UI. Read-only branches (the default branch, main, master) reject edits; pass create=true to create a working branch from the default branch head and switch to it. Fails if create=true and the branch already exists, or if create=false and it does not.
The description explains the capability, when to use it, and what to expect.
Inputs74/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
name
Branch name, e.g. 'feature/margin-model'.
Clear enough to supply this argument.
create
Create the branch from the default branch head before switching.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "switch_branch",
"title": "Switch Config Branch",
"description": "Switch the git config branch that your model and memory edits land on. Requires a connected config repo. The choice is per user and shared with the app UI. Read-only branches (the default branch, main, master) reject edits; pass create=true to create a working branch from the default branch head and switch to it. Fails if create=true and the branch already exists, or if create=false and it does not.",
"inputSchema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Branch name, e.g. 'feature/margin-model'."
},
"create": {
"type": "boolean",
"description": "Create the branch from the default branch head before switching."
}
}
},
"annotations": {
"title": "Switch Config Branch",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description73/100
Create or update a block and resolve it. Set `type` to pick the block kind, and pass only the fields that kind accepts. `text` and `table`: user_prompt (required), call_llm, behavior_if_query_fails; plus allowed_outputs for text and target_shape for table. `chart`: query and chart_details (both required), sample_values, add_default_filters. `query`: a numerical query inside a text or table block; `location` names that parent block; query_name and query (both required), mode, pivot_dimension, transpose, sample_values, max_return_rows, add_default_filters. Chart and query blocks take a SlayerQuery (single object or a list of stages) and validate it against the data.
The description explains the capability, when to use it, and what to expect.
Inputs36/100
94 of 203 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
type
Block kind: 'text', 'table', 'chart', or 'query' (a numerical query inside a text or table block).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
location › doc_id
The ID of the deck (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
location › slide_name
The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents.
Clear enough to supply this argument.
location › block_name
The name of the block
Explain the meaning of this value, not just its name.
user_prompt
The new user prompt for the text block template. Reference another block's value with a directive of the form ``:var[{total_parcs}]{name="total_parcs"}`` — the bracketed part is the displayed placeholder and ``name`` is the referenced block. A bare ``:var[total_parcs]`` is NOT valid.
Clear enough to supply this argument.
call_llm
Set to true ONLY if you need the LLM to rephrase or summarize the result of a query referenced in user_prompt. Requires at least one :var[{value}]{name="block_name"} reference in user_prompt. Leave false when the prompt already contains the final text.
Clear enough to supply this argument.
allowed_outputs
Allowed outputs for constrained LLM generation (only valid when call_llm=True)
Clear enough to supply this argument.
target_shape
Target shape constraints for the table as (rows, columns). Each dimension can be None (no constraint), an int (exact count), or a tuple of two ints (min, max range).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
behavior_if_query_fails
What happens if a child query fails: 'drop_slide' (skip slide gracefully) or 'fail_resolution' (raise error). If not provided, unchanged.
Clear enough to supply this argument.
query_name
The name of the query within the parent block's queries list
Clear enough to supply this argument.
query › anyOf › 0 › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › offset
Rows to skip.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › distinct_dimension_values
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › version
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › name
Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=["memory:help.queries"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The buckets to return: one period ("2025", "2025-Q1", "last month") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just "2025": never widen the range and drop rows afterwards. cumsum starts at the range start.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › main_time_dimension
Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › filters
Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.
- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.
- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.
- A list tags: contains(tags, 'x') or tags.value = 'x'.
- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.
- {variable} placeholders take values from variables.
More: inspect(reference=["memory:help.time", "memory:help.joins"], entity_type="memory").
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 1 › items › limit
Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › offset
Rows to skip.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › to_many_handling
What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series › additionalProperties › type
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series › additionalProperties › y_axis
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series › additionalProperties › number_format › v
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series › additionalProperties › number_format › type
The format type for number display
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series › additionalProperties › number_format › precision
Number of decimal places to show
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series › additionalProperties › number_format › symbol
Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series › additionalProperties › label
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series › additionalProperties › show_values
Show numeric values as text next to each data point?
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › legend › enabled
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › legend › location
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › legend › orientation
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › legend › bump
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › xAxis › lines
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › xAxis › label
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › xAxis › scale
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › yAxis › lines
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › yAxis › label
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › yAxis › scale
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › y2Axis › lines
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › y2Axis › label
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › y2Axis › scale
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › color_scheme
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › title
The title of the chart
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › locale
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › date_format
Explicit Babel date-format string (e.g. 'MMM yyyy'). Leave unset to let the renderer choose a granularity-appropriate default.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series_default › type
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series_default › y_axis
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series_default › number_format › v
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series_default › number_format › type
The format type for number display
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series_default › number_format › symbol
Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
chart_details › series_default › label
Not provided
Missing description. Explain what this value means and how to supply it.
chart_details › series_default › show_values
Show numeric values as text next to each data point?
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
mode
Query mode: 'single_number' returns a single aggregate value, 'table' returns a full result set (multiple rows/columns, supports pivoting). Defaults to 'single_number'.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
pivot_dimension
Dimension to pivot into columns (only for mode='table'). Accepts 'dim_name' or 'model_name.dim_name'. If None, no pivot is performed.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
transpose
Whether to transpose the table, swapping rows and columns (only for mode='table'). Defaults to False if not specified.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
sample_values
Override filter values (e.g. start_date, end_date, plus any source-specific variables exposed by get_doc_variables) for chart resolution context. Takes priority over the deck's stored parameters.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
max_return_rows
Maximum number of data rows to include in the response preview.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
add_default_filters
Whether to apply default model filters (e.g. time range, tenant). Set to False to generate a query without any automatic filter constraints.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "update_block",
"title": "Update Block",
"description": "Create or update a block and resolve it. Set `type` to pick the block kind, and pass only the fields that kind accepts. `text` and `table`: user_prompt (required), call_llm, behavior_if_query_fails; plus allowed_outputs for text and target_shape for table. `chart`: query and chart_details (both required), sample_values, add_default_filters. `query`: a numerical query inside a text or table block; `location` names that parent block; query_name and query (both required), mode, pivot_dimension, transpose, sample_values, max_return_rows, add_default_filters. Chart and query blocks take a SlayerQuery (single object or a list of stages) and validate it against the data.",
"inputSchema": {
"type": "object",
"required": [
"type",
"location"
],
"properties": {
"mode": {
"type": "string",
"description": "Query mode: 'single_number' returns a single aggregate value, 'table' returns a full result set (multiple rows/columns, supports pivoting). Defaults to 'single_number'."
},
"type": {
"enum": [
"text",
"table",
"chart",
"query"
],
"type": "string",
"description": "Block kind: 'text', 'table', 'chart', or 'query' (a numerical query inside a text or table block)."
},
"query": {
"anyOf": [
{
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "One subquery of a :class:`SlayerFormatQuery`.\n\nInherits slayer ``SlayerQuery``'s ``extra=\"forbid\"`` and every field\ndescription; overrides only ``source_model`` (required, no inline full\nmodel) and ``variables`` (typed with :data:`SlayerVariableValue`).",
"additionalProperties": false
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name. In a list of query objects every entry but the last carries a name, and later stages use it as their source_model. A STAGE IS NOT NEEDED for top N per group (filter on `rank(...)` in the same stage), for averaging or bucketing per-entity totals (a nested aggregate, or a computed dimension with `partition_by`), or for shares and totals (`partition_by`). A filter on a transform's value (`rank(...) <= 3`, `cumsum(...) > 100`) applies after it, which is computed over every row the other filters keep. Stages ARE needed only to drop rows by a dimension or time condition that a cross-row value must still see, or to join or reuse a whole result: a row filter or date_range applies before a running total, lag / lead, rank, ntile, consecutive_periods or `partition_by` total (change, change_pct, time_shift and window= still read past date_range or a filter on their own time dimension, but not past other filters). Compute the value in an inner stage and filter in the outer one. An outer stage sees the inner result's columns with dotted paths flattened to __: an inner dimension customers.regions.name is customers__regions__name outside; a measure keeps its name. More: inspect(reference=[\"memory:help.queries\"], entity_type=\"memory\")."
},
"limit": {
"type": "integer",
"description": "Max rows to return: the top N, or a limit covering a list longer than the 20 rows an uncapped MCP response returns (with a notice). Never use it to cut a list asked for in full."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
}
]
},
"direction": {
"type": "string"
}
},
"description": "A sort key.",
"additionalProperties": false
},
"description": "Sort keys, [{\"column\": ..., \"direction\": \"asc\" | \"desc\"}]. column is a result column name or any aggregate or transform expression, displayed or not: with measures [\"count(*)\"], [{\"column\": \"sum(amount)\", \"direction\": \"desc\"}] sorts by an amount it does not return. Add limit for the top N. Return only the columns the question asks for: never add the sort value to measures just to sort by it."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Conditions, AND-ed; each routes automatically to row filtering (WHERE), aggregate filtering (HAVING) or filtering after transforms. Operators: == != < <= > >=, in, like, is null / is not null, and / or / not; build text literals from the column's sampled values.\n- Aggregates and transforms filter too, by formula or by a measure's name: sum(amount) > 100; top N per group: rank(sum(amount), partition_by=customers.regions.name, direction='desc') <= 1.\n- Anti-join: rooted at customers, orders.id is null keeps the customers without orders.\n- A list tags: contains(tags, 'x') or tags.value = 'x'.\n- Time points: a string compared with a date/time column is a half-open period: '2025', '2025-Q1', '2025-03', '2025-W05' (ISO week), '2025-03-01' (the whole day), or relative: 'today', 'last month', 'last 7 days' (excludes the current day), 'year to date'. order_date >= '2025-Q1' starts at the period, <= ends with it, order_date in '2025-Q1' is inside it.\n- {variable} placeholders take values from variables.\nMore: inspect(reference=[\"memory:help.time\", \"memory:help.joins\"], entity_type=\"memory\")."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
},
"description": "Values to return: formula strings or {\"formula\": ..., \"name\": ...} (name sets the result key; a bare name references a saved model measure). Formulas combine aggregations with arithmetic, also across models: rooted at customers, sum(orders.amount) / count(*) divides the orders' total by the number of customers.\n- Aggregations: count(*), sum(amount), count_distinct(customer_id), avg(amount - cost), percentile(amount, p=0.9); a joined model's field by dotted path.\n- partition_by= computes an aggregate at a coarser grain, repeated on every row; spell its keys exactly like the query's dimensions (a joined column by its dotted path; its bare name fails). Share of group: sum(amount) / sum(amount, partition_by=customers.regions.name); share of the grand total: sum(amount) / sum(amount, partition_by=[]).\n- window= turns any aggregation into a trailing time window ending at each time bucket, in compact durations only ('90d', '3m', '1y'; never '3 months'): count_distinct(customer_id, window='90d').\n- Nesting aggregates per-group values: avg(sum(amount, partition_by=[customers.regions.name, customers.id]), partition_by=[customers.regions.name]) averages the per-customer totals in each region.\n- Transforms wrap an aggregate; all but the rank family need a time dimension: cumsum(sum(amount)) running total; change(sum(amount)) / change_pct(sum(amount)) period-over-period delta / ratio; time_shift(sum(amount), -1) the previous bucket's value ('year' as a third argument for year-over-year); lag(x, n) / lead(x, n) n rows back / ahead; rank(x, direction='desc') / dense_rank(x, direction='asc') with direction required and partition_by= to rank within groups; ntile(x, n=4) buckets, lowest first; consecutive_periods(sum(amount) > 0) trailing run length.\n- A joined model's aggregate such as sum(customers.credit) from orders is computed over that model's own rows, each customer once. Sliced by a dimension it cannot be attributed to (an order's status), it repeats its total on every row with a warning; to_many_handling='associate' splits it per group. Rooted at customers, sum(orders.amount) and sum(returns.amount) in one query are each computed over their own rows: several child models never fan out or double count. A child row without a parent (an order with no customer) has NULL parent columns: it counts in the NULL row of a parent dimension when that row exists, and in an ungrouped total; never add it again. An aggregate over a model no join path reaches from the root is computed over that model's own rows and repeated on every row (per bucket of a time_spine time dimension), with an unrelated_dataset warning: rooted at customers, count(events.id) / count(*).\nMore (every aggregation, empty-input values, nesting and transform rules): inspect(reference=[\"memory:help.aggregations\", \"memory:help.transforms\"], entity_type=\"memory\")."
},
"variables": {
"type": "object",
"description": "Normally omitted — filled from the document context (deck variables, sample_values, or the tool's `variables` argument). `start_date` / `end_date` here pin the document's range; other names carry constants (which the document context overrides) or one-level date expressions (`{\"type\": \"date\"|\"variable\"|\"calc\", ...}`, computed from the context and applied on top of it).",
"additionalProperties": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
},
{
"type": "object",
"required": [
"left",
"right",
"operator"
],
"properties": {
"left": {
"anyOf": [
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "date",
"description": "Discriminator tag for the DateExpression union. Always 'date'."
},
"value": {
"type": "string",
"format": "date",
"description": "Absolute ISO date (YYYY-MM-DD). Used verbatim at resolve time."
}
},
"description": "An absolute date literal — ``value`` is the resolved date as-is."
},
{
"type": "object",
"required": [
"value"
],
"properties": {
"type": {
"type": "string",
"const": "variable",
"description": "Discriminator tag for the DateExpression union. Always 'variable'."
},
"value": {
"type": "string",
"description": "Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context."
}
},
"description": "Reference to a deck-level resolution-context variable.\n\nAt resolve time, the variable's value is looked up in the resolution\ncontext. The context value may be a :class:`datetime.date` or an ISO\ndate string; both are accepted."
}
],
"description": "Base date as either a DateLiteral or DateVariable. Nested DateCalc is intentionally not allowed; keep expressions one level deep."
},
"type": {
"type": "string",
"const": "calc",
"description": "Discriminator tag for the DateExpression union. Always 'calc'."
},
"right": {
"type": "object",
"required": [
"unit",
"value"
],
"properties": {
"type": {
"type": "string",
"const": "delta",
"description": "Discriminator tag for the delta node. Always 'delta'."
},
"unit": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
],
"type": "string",
"description": "Time unit for the offset. One of: day, week, month, quarter, year. Sub-day units (second, minute, hour) are accepted by the type but are no-ops at date granularity."
},
"value": {
"type": "integer",
"description": "Non-negative count of `unit`. Sign is carried on the operator."
}
},
"description": "Non-negative time offset applied to `left` per `operator`."
},
"operator": {
"enum": [
"+",
"-"
],
"type": "string",
"description": "Either '+' (left + right) or '-' (left - right)."
}
},
"description": "One-level date arithmetic: ``left (+|-) right``.\n\nThe left operand is a literal or variable (NOT another calc). The\nright operand is a :class:`DateDelta` carrying a non-negative count."
}
],
"discriminator": {
"mapping": {
"calc": "#/$defs/DateCalc",
"date": "#/$defs/DateLiteral",
"variable": "#/$defs/DateVariable"
},
"propertyName": "type"
}
},
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
{
"type": "null"
}
]
}
},
"dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed from an ``expression``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns, one result row per distinct combination: names, dotted paths to joined columns (customers.regions.name), or computed {\"expression\": ..., \"name\": ...}. A granularity call buckets a timestamp like a time_dimensions entry: month(created_at); granularities are second, minute, hour, day, week, week_sunday, month, quarter, year, or the datasource's custom ones. An aggregate inside a computed dimension needs partition_by= to fix its grain: {\"expression\": \"iif(sum(amount, partition_by=customers.id) > 150, 'high', 'low')\", \"name\": \"spend_band\"}. Group by naturally readable labels: a name (customers.regions.name), never by an id alone unless ids are asked for; when a name may repeat (people, products), by the id and the name."
},
"source_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": [
"source_name"
],
"properties": {
"joins": {
"type": "array",
"items": {
"type": "object",
"required": [
"target_model",
"join_pairs"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"join_type": {
"enum": [
"left",
"inner"
],
"type": "string"
},
"join_pairs": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"cardinality": {
"enum": [
"one_to_one",
"one_to_many",
"many_to_one",
"many_to_many"
],
"type": "string",
"description": "Arity of a join, read source->target (\"many orders -> one customer\").\n\nDescriptive metadata, orthogonal to ``JoinType`` — it does not change the\nemitted join."
},
"description": {
"type": "string"
},
"target_model": {
"type": "string"
}
},
"description": "A join relationship to another model."
}
},
"columns": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"sql": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "string"
},
"format": {
"type": "object",
"properties": {
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Number format specification for measures and dimensions."
},
"hidden": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"db_type": {
"type": "string",
"description": "Raw database type string (e.g. 'point', 'DECIMAL(18, 2)'), retained when the declared DataType loses information. Populated by ingestion for UNKNOWN (opaque) and exact NUMERIC/DECIMAL columns; None when the mapped type carries everything needed."
},
"sampled": {
"type": "string"
},
"description": {
"type": "string"
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Time bucket the column's values are already truncated to: a built-in granularity or a custom granularity defined on the model's datasource. Query-backed models stamp it from the final stage; on a table-backed column set it by hand only when you are sure the values are bucketed at that granularity. A finer or non-nesting time dimension over the column is then a typed error."
},
"primary_key": {
"type": "boolean"
},
"element_type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string",
"description": "A list's element type."
},
"distinct_count": {
"type": "integer"
},
"sampled_values": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_aggregations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A row-level column, usable per-query as a GROUP BY dimension or an aggregation measure."
}
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string",
"description": "Result key; filters and order may use it in place of the formula."
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN",
"ARRAY"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string",
"description": "Same syntax as the query object's measures."
},
"description": {
"type": "string"
}
},
"description": "A named aggregation formula, inline in a query or saved on a model and referenced by bare name."
}
},
"source_name": {
"type": "string"
}
},
"description": "Extend a model inline on a query with extra columns, measures, or joins, without modifying the stored model.",
"additionalProperties": false
}
],
"description": "Name of the stored SLayer model this subquery reads from (or an earlier subquery's `name`), or a ModelExtension that extends a named model with inline columns / measures / joins for this query."
},
"time_dimensions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"required": [
"dimension",
"granularity"
],
"properties": {
"label": {
"type": "string"
},
"dimension": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path."
},
"date_range": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"description": "The buckets to return: one period (\"2025\", \"2025-Q1\", \"last month\") or [lower, upper] with either bound null (one-sided). change, change_pct, time_shift and window= aggregates read rows before the range (a forward time_shift, after it) by themselves, so each month of 2025 with its change vs the previous month is just \"2025\": never widen the range and drop rows afterwards. cumsum starts at the range start."
},
"granularity": {
"anyOf": [
{
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
},
{
"type": "string"
}
],
"description": "A built-in granularity, or a custom granularity defined on the query's datasource."
}
},
"description": "A time-bucketed group-by: ``dimension`` truncated to ``granularity``."
},
{
"type": "string"
}
]
},
"description": "Time-bucketed group-bys — one result row per bucket. Each entry is a TimeDimension dict or the functional string gran(col), e.g. \"month(created_at)\". Buckets without rows are absent. To return every bucket, empty ones included, bucket time_spine.timestamp with a lower date_range bound and measure models by dotted path: {\"dimension\": \"time_spine.timestamp\", \"granularity\": \"month\", \"date_range\": \"2025\"} with sum(orders.amount) returns all twelve months. It also lines several models up on one time axis."
},
"to_many_handling": {
"enum": [
"broadcast",
"associate",
"error"
],
"type": "string",
"description": "What happens when an aggregation is sliced by a dimension not attributable to it: broadcast (default — repeat the value across the cells, with a warning) | associate (aggregate per cell over the distinct associated entities, e.g. per list element tags.value) | error (refuse)."
},
"whole_periods_only": {
"type": "boolean",
"description": "Snap date filters to whole time buckets and drop the current incomplete bucket."
},
"main_time_dimension": {
"type": "string",
"description": "Name of the time dimension that time-ordered transforms (change, lag, ...) key off; overrides auto-detection when the query has multiple time dimensions."
},
"distinct_dimension_values": {
"type": "boolean",
"description": "Default true: dimension-only queries return distinct dimension combinations (GROUP BY the projected dimensions). Set false for raw per-record rows — requires empty `measures` and no measure reference in `filters`/`order`. For rows plus a count, keep the default and add `count(*)`."
}
},
"description": "One subquery of a :class:`SlayerFormatQuery`.\n\nInherits slayer ``SlayerQuery``'s ``extra=\"forbid\"`` and every field\ndescription; overrides only ``source_model`` (required, no inline full\nmodel) and ``variables`` (typed with :data:`SlayerVariableValue`).",
"additionalProperties": false
},
"minItems": 1
},
{
"type": "null"
}
],
"description": "A slayer-native query: a single SlayerQuery object, or a list of them (a multi-stage DAG whose LAST entry is the root). Each has `source_model` (a stored model name, or a ModelExtension), and `measures` / `dimensions` / `filters` as SLayer DSL strings (e.g. `'revenue:sum'`, `'*:count'`, `\"status == 'completed'\"`), plus `time_dimensions`, `order`, `limit`. Express a date range as an ordinary filter with `{start_date}` / `{end_date}` placeholders (e.g. `\"created_at >= '{start_date}'\"`). For period-over-period comparison, add a measure with a `time_shift(...)` formula (e.g. `time_shift(revenue:sum, -1, 'year')`). `variables` is normally omitted and filled from the document context; set `start_date` / `end_date` in it to pin the document's range, or other names to carry constants (the document context overrides them) or one-level date expressions (computed from the context, applied on top of it)."
},
"call_llm": {
"type": "boolean",
"description": "Set to true ONLY if you need the LLM to rephrase or summarize the result of a query referenced in user_prompt. Requires at least one :var[{value}]{name=\"block_name\"} reference in user_prompt. Leave false when the prompt already contains the final text."
},
"location": {
"type": "object",
"required": [
"doc_id",
"block_name"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the deck (SlideDeck.id)"
},
"block_name": {
"type": "string",
"description": "The name of the block"
},
"slide_name": {
"type": "string",
"description": "The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents."
}
},
"description": "Location of the block (doc_id, slide_name, block_name). For type='query', block_name is the parent text or table block.",
"additionalProperties": false
},
"transpose": {
"type": "boolean",
"description": "Whether to transpose the table, swapping rows and columns (only for mode='table'). Defaults to False if not specified."
},
"query_name": {
"type": "string",
"description": "The name of the query within the parent block's queries list"
},
"user_prompt": {
"type": "string",
"description": "The new user prompt for the text block template. Reference another block's value with a directive of the form ``:var[{total_parcs}]{name=\"total_parcs\"}`` — the bracketed part is the displayed placeholder and ``name`` is the referenced block. A bare ``:var[total_parcs]`` is NOT valid."
},
"target_shape": {
"type": "array",
"maxItems": 2,
"minItems": 2,
"description": "Target shape constraints for the table as (rows, columns). Each dimension can be None (no constraint), an int (exact count), or a tuple of two ints (min, max range).",
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "array",
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
}
]
},
{
"type": "null"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "array",
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
}
]
},
{
"type": "null"
}
]
}
]
},
"chart_details": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title of the chart"
},
"xAxis": {
"type": "object",
"properties": {
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean",
"const": false
},
{
"type": "null"
}
]
},
"lines": {
"type": "boolean"
},
"scale": {
"enum": [
"linear",
"logarithmic"
],
"type": "string"
}
}
},
"yAxis": {
"type": "object",
"properties": {
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean",
"const": false
},
{
"type": "null"
}
]
},
"lines": {
"type": "boolean"
},
"scale": {
"enum": [
"linear",
"logarithmic"
],
"type": "string"
}
}
},
"legend": {
"type": "object",
"properties": {
"bump": {
"type": "number"
},
"enabled": {
"type": "boolean"
},
"location": {
"type": "string"
},
"orientation": {
"enum": [
"h",
"v",
"auto"
],
"type": "string"
}
}
},
"locale": {
"enum": [
"en_US.UTF-8",
"es_ES.UTF-8",
"fr_FR.UTF-8",
"de_DE.UTF-8",
"it_IT.UTF-8",
"pt_PT.UTF-8",
"zh_CN.UTF-8",
"ja_JP.UTF-8",
"ko_KR.UTF-8",
"ru_RU.UTF-8",
"ar_SA.UTF-8",
"hi_IN.UTF-8"
],
"type": "string"
},
"series": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"type": {
"enum": [
"bar",
"line",
"pie",
"funnel"
],
"type": "string"
},
"label": {
"type": "string"
},
"y_axis": {
"enum": [
"left",
"right"
],
"type": "string"
},
"show_values": {
"type": "boolean",
"description": "Show numeric values as text next to each data point?"
},
"number_format": {
"type": "object",
"properties": {
"v": {
"type": "integer"
},
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Unified number format specification for charts, queries, and semantic layer.\n\nThis is the canonical type for number formatting across the codebase.\nReplaces the former MeasureFormat, NumberDisplayFormat, and old NumberFormat types."
}
}
}
},
"y2Axis": {
"type": "object",
"properties": {
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean",
"const": false
},
{
"type": "null"
}
]
},
"lines": {
"type": "boolean"
},
"scale": {
"enum": [
"linear",
"logarithmic"
],
"type": "string"
}
}
},
"date_format": {
"type": "string",
"description": "Explicit Babel date-format string (e.g. 'MMM yyyy'). Leave unset to let the renderer choose a granularity-appropriate default."
},
"color_scheme": {
"type": "string"
},
"series_default": {
"type": "object",
"properties": {
"type": {
"enum": [
"bar",
"line",
"pie",
"funnel"
],
"type": "string"
},
"label": {
"type": "string"
},
"y_axis": {
"enum": [
"left",
"right"
],
"type": "string"
},
"show_values": {
"type": "boolean",
"description": "Show numeric values as text next to each data point?"
},
"number_format": {
"type": "object",
"properties": {
"v": {
"type": "integer"
},
"type": {
"enum": [
"percent",
"currency",
"integer",
"float"
],
"type": "string",
"description": "The format type for number display"
},
"symbol": {
"type": "string",
"description": "Currency symbol (defaults to $ for CURRENCY type, must be None otherwise)"
},
"precision": {
"type": "integer",
"description": "Number of decimal places to show"
}
},
"description": "Unified number format specification for charts, queries, and semantic layer.\n\nThis is the canonical type for number formatting across the codebase.\nReplaces the former MeasureFormat, NumberDisplayFormat, and old NumberFormat types."
}
}
}
},
"description": "Chart styling configuration (series, axes, title, color_scheme, etc.)."
},
"sample_values": {
"type": "object",
"description": "Override filter values (e.g. start_date, end_date, plus any source-specific variables exposed by get_doc_variables) for chart resolution context. Takes priority over the deck's stored parameters.",
"additionalProperties": {
"type": "string"
}
},
"allowed_outputs": {
"type": "array",
"items": {
"type": "string"
},
"description": "Allowed outputs for constrained LLM generation (only valid when call_llm=True)"
},
"max_return_rows": {
"type": "integer",
"description": "Maximum number of data rows to include in the response preview."
},
"pivot_dimension": {
"type": "string",
"description": "Dimension to pivot into columns (only for mode='table'). Accepts 'dim_name' or 'model_name.dim_name'. If None, no pivot is performed."
},
"add_default_filters": {
"type": "boolean",
"description": "Whether to apply default model filters (e.g. time range, tenant). Set to False to generate a query without any automatic filter constraints."
},
"behavior_if_query_fails": {
"enum": [
"drop_slide",
"fail_resolution"
],
"type": "string",
"description": "What happens if a child query fails: 'drop_slide' (skip slide gracefully) or 'fail_resolution' (raise error). If not provided, unchanged."
}
},
"additionalProperties": false
},
"annotations": {
"title": "Update Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "render_chart_block",
"title": "Render Chart Image",
"description": "Render a chart block to a PNG image and return it as base64-encoded data. If the chart is not resolved (no content), resolution is triggered first.",
"inputSchema": {
"type": "object",
"required": [
"location"
],
"properties": {
"width": {
"type": "integer",
"description": "Image width in pixels. Default: 800."
},
"height": {
"type": "integer",
"description": "Image height in pixels. Default: 600."
},
"location": {
"type": "object",
"required": [
"doc_id",
"block_name"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the deck (SlideDeck.id)"
},
"block_name": {
"type": "string",
"description": "The name of the block"
},
"slide_name": {
"type": "string",
"description": "The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents."
}
},
"description": "Location of the chart block within the deck",
"additionalProperties": false
}
}
},
"annotations": {
"title": "Render Chart Image",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description81/100
List available resources. Use what='documents' to list all documents accessible to the current user (supports optional query filter). Use what='masters' to list master template decks (same fields as documents). Use what='styles' to list available presentation styles. Use what='datasources' to list source IDs for available datasources. Use what='branches' to list the git config branches and see which one is active for you (empty when no config repo is connected).
The description explains the capability, when to use it, and what to expect.
Inputs88/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
what
The type of resource to list
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query
Optional search string to filter by title (case-insensitive partial match). Used when what='documents' or what='masters'.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "list_resources",
"title": "List Resources",
"description": "List available resources. Use what='documents' to list all documents accessible to the current user (supports optional query filter). Use what='masters' to list master template decks (same fields as documents). Use what='styles' to list available presentation styles. Use what='datasources' to list source IDs for available datasources. Use what='branches' to list the git config branches and see which one is active for you (empty when no config repo is connected).",
"inputSchema": {
"type": "object",
"required": [
"what"
],
"properties": {
"what": {
"enum": [
"documents",
"masters",
"styles",
"datasources",
"branches"
],
"type": "string",
"description": "The type of resource to list"
},
"query": {
"type": "string",
"description": "Optional search string to filter by title (case-insensitive partial match). Used when what='documents' or what='masters'."
}
}
},
"annotations": {
"title": "List Resources",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description85/100
Create a new blank document (single-slide deck) for data-driven content. The document starts with one empty slide and no output format — blocks can be added via update_block. The source_id is used to derive default filter parameters (e.g. date range, client name) for query resolution.
The description explains the capability, when to use it, and what to expect.
Inputs73/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
name
Name/title of the document
Clear enough to supply this argument.
source_id
ID of the data source (used to derive default filter parameters for query resolution)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
description
Optional description of the document
Explain the meaning of this value, not just its name.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "create_document",
"title": "Create Document",
"description": "Create a new blank document (single-slide deck) for data-driven content. The document starts with one empty slide and no output format — blocks can be added via update_block. The source_id is used to derive default filter parameters (e.g. date range, client name) for query resolution.",
"inputSchema": {
"type": "object",
"required": [
"name",
"source_id"
],
"properties": {
"name": {
"type": "string",
"description": "Name/title of the document"
},
"source_id": {
"type": "string",
"format": "uuid",
"description": "ID of the data source (used to derive default filter parameters for query resolution)"
},
"description": {
"type": "string",
"description": "Optional description of the document"
}
}
},
"annotations": {
"title": "Create Document",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description97/100
Soft-delete a document (deck). Sets deleted_at on the deck and its slides; the document is hidden from subsequent listings and inspections. Returns the document id and the deleted_at timestamp.
The description explains the capability, when to use it, and what to expect.
Inputs75/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
document_id
The ID of the document (SlideDeck.id) to delete
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "delete_document",
"title": "Delete Document",
"description": "Soft-delete a document (deck). Sets deleted_at on the deck and its slides; the document is hidden from subsequent listings and inspections. Returns the document id and the deleted_at timestamp.",
"inputSchema": {
"type": "object",
"required": [
"document_id"
],
"properties": {
"document_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the document (SlideDeck.id) to delete"
}
}
},
"annotations": {
"title": "Delete Document",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description92/100
Inspect a document or master, optionally a slide or block. The same tool handles both documents and masters — pass the deck's doc_id (SlideDeck.id). Provide doc_id only to get the outline (slide names, block names); when the deck is a master, the outline also includes a `resolutions` list summarizing past resolutions. Add slide_name to get full slide content. Add block_name to get a specific block with full data.
The description explains the capability, when to use it, and what to expect.
Inputs58/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
doc_id
The ID of the deck (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
slide_name
The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents.
Resolve the mismatch between this description and its schema constraints.
block_name
The name of a specific block to inspect. If provided, returns detailed block content instead of the full slide.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "inspect_document",
"title": "Inspect Document",
"description": "Inspect a document or master, optionally a slide or block. The same tool handles both documents and masters — pass the deck's doc_id (SlideDeck.id). Provide doc_id only to get the outline (slide names, block names); when the deck is a master, the outline also includes a `resolutions` list summarizing past resolutions. Add slide_name to get full slide content. Add block_name to get a specific block with full data.",
"inputSchema": {
"type": "object",
"required": [
"doc_id"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the deck (SlideDeck.id)"
},
"block_name": {
"type": "string",
"description": "The name of a specific block to inspect. If provided, returns detailed block content instead of the full slide."
},
"slide_name": {
"type": "string",
"description": "The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents."
}
}
},
"annotations": {
"title": "Inspect Document",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "get_doc_variables",
"title": "Get Document Variables",
"description": "Get all variables and their values for a deck",
"inputSchema": {
"type": "object",
"required": [
"doc_id"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the deck (SlideDeck.id)"
},
"slide_name": {
"type": "string",
"description": "Filter variables to a specific slide by name. If not provided, returns variables from all slides."
},
"show_content": {
"type": "boolean",
"description": "Whether to include the full payload content for each variable. Defaults to False."
},
"show_context_vars": {
"type": "boolean",
"description": "Whether to include context variables (magic keys and resolution context entries). Defaults to True."
}
}
},
"annotations": {
"title": "Get Document Variables",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description86/100
Set variables on a document's resolution_context and re-resolve all blocks. Use get_doc_variables first to discover available variable names. Provided values are merged with the existing resolution_context entries. Optionally link a variable to a cube column via `column_links` (e.g. {"client_name": "customers.name"}) to make its value picker searchable.
The description explains the capability, when to use it, and what to expect.
Inputs60/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
doc_id
The ID of the document (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
variables
Key-value pairs to set. Keys are variable names — discover them via get_doc_variables, plus date keys like 'start_date' / 'end_date'. Values are strings, numbers, dates (ISO format), or booleans.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
column_links › additionalProperties › name
The name of the dimension or measure
Explain the meaning of this value, not just its name.
column_links › additionalProperties › model_name
The name of the model that the dimension or measure belongs to
Explain the meaning of this value, not just its name.
column_links › additionalProperties › description
A description of the dimension or measure
Explain the meaning of this value, not just its name.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "set_doc_variables",
"title": "Set Document Variables",
"description": "Set variables on a document's resolution_context and re-resolve all blocks. Use get_doc_variables first to discover available variable names. Provided values are merged with the existing resolution_context entries. Optionally link a variable to a cube column via `column_links` (e.g. {\"client_name\": \"customers.name\"}) to make its value picker searchable.",
"inputSchema": {
"type": "object",
"required": [
"doc_id",
"variables"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the document (SlideDeck.id)"
},
"variables": {
"type": "object",
"description": "Key-value pairs to set. Keys are variable names — discover them via get_doc_variables, plus date keys like 'start_date' / 'end_date'. Values are strings, numbers, dates (ISO format), or booleans.",
"additionalProperties": true
},
"column_links": {
"type": "object",
"description": "Optional. Maps a variable name (a key in `variables`, or one already in the context) to the model column its value filters on. Each value is either a dotted \"model_name.column_name\" string or an object {\"cube_name\": ..., \"name\": ...}, e.g. {\"client_name\": \"customers.name\"}. Makes the variable's value picker searchable against that column. Merge semantics: variables NOT listed here keep their existing link; map a variable to null to delete its link. Only applies to global variables.",
"additionalProperties": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the dimension or measure"
},
"model_name": {
"type": "string",
"description": "The name of the model that the dimension or measure belongs to"
},
"description": {
"type": "string",
"description": "A description of the dimension or measure"
}
},
"additionalProperties": true
}
}
}
},
"annotations": {
"title": "Set Document Variables",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description79/100
Move a block to a new position within a document. Supply either location (zero-based index) or after_block (name of the block to place after), but not both.
The description explains the capability, when to use it, and what to expect.
Inputs75/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
doc_id
The ID of the document (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
block_name
Name of the block to move
Explain the meaning of this value, not just its name.
location
Zero-based target position for the block. Mutually exclusive with after_block.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
after_block
Name of the block to place this block after. Mutually exclusive with location.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "move_block",
"title": "Move Block",
"description": "Move a block to a new position within a document. Supply either location (zero-based index) or after_block (name of the block to place after), but not both.",
"inputSchema": {
"type": "object",
"required": [
"doc_id",
"block_name"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the document (SlideDeck.id)"
},
"location": {
"type": "integer",
"description": "Zero-based target position for the block. Mutually exclusive with after_block."
},
"block_name": {
"type": "string",
"description": "Name of the block to move"
},
"after_block": {
"type": "string",
"description": "Name of the block to place this block after. Mutually exclusive with location."
}
}
},
"annotations": {
"title": "Move Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description89/100
Delete a top-level block from a document's slide layout. Supports text, chart, table, image, and numerical_query blocks. Blocks nested inside row/column containers cannot be deleted with this tool. To delete a numerical query nested inside a text or table block's queries list, set `query_name` and point `location` at that parent block; this also removes the query's reference from the parent template and marks dependent blocks as out-of-date.
The description explains the capability, when to use it, and what to expect.
Inputs81/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
location › doc_id
The ID of the deck (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
location › slide_name
The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents.
Clear enough to supply this argument.
location › block_name
The name of the block
Explain the meaning of this value, not just its name.
query_name
Name of a numerical query inside the parent block's queries list. Set it to delete that query instead of the whole block.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "delete_block",
"title": "Delete Block",
"description": "Delete a top-level block from a document's slide layout. Supports text, chart, table, image, and numerical_query blocks. Blocks nested inside row/column containers cannot be deleted with this tool. To delete a numerical query nested inside a text or table block's queries list, set `query_name` and point `location` at that parent block; this also removes the query's reference from the parent template and marks dependent blocks as out-of-date.",
"inputSchema": {
"type": "object",
"required": [
"location"
],
"properties": {
"location": {
"type": "object",
"required": [
"doc_id",
"block_name"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the deck (SlideDeck.id)"
},
"block_name": {
"type": "string",
"description": "The name of the block"
},
"slide_name": {
"type": "string",
"description": "The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents."
}
},
"description": "Location of the block to delete (doc_id, slide_name, block_name). With query_name, block_name is the parent text or table block.",
"additionalProperties": false
},
"query_name": {
"type": "string",
"description": "Name of a numerical query inside the parent block's queries list. Set it to delete that query instead of the whole block."
}
}
},
"annotations": {
"title": "Delete Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description95/100
Rename a block in a slide. Preserves type, content, template, and position; only changes the block's name identifier. References to the old name from other blocks (e.g. :var[]{name="old_name"}) are NOT automatically rewritten — fix them separately if needed.
The description explains the capability, when to use it, and what to expect.
Inputs50/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
location › doc_id
The ID of the deck (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
location › slide_name
The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents.
Resolve the mismatch between this description and its schema constraints.
location › block_name
The name of the block
Explain the meaning of this value, not just its name.
new_name
New name for the block. Must be non-empty and unique within the slide.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "rename_block",
"title": "Rename Block",
"description": "Rename a block in a slide. Preserves type, content, template, and position; only changes the block's name identifier. References to the old name from other blocks (e.g. :var[]{name=\"old_name\"}) are NOT automatically rewritten — fix them separately if needed.",
"inputSchema": {
"type": "object",
"required": [
"location",
"new_name"
],
"properties": {
"location": {
"type": "object",
"required": [
"doc_id",
"block_name"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the deck (SlideDeck.id)"
},
"block_name": {
"type": "string",
"description": "The name of the block"
},
"slide_name": {
"type": "string",
"description": "The name of the slide. Required for regular (multi-slide) decks. Ignored for single-mode documents."
}
},
"description": "Location of the block to rename (doc_id, slide_name, block_name).",
"additionalProperties": false
},
"new_name": {
"type": "string",
"description": "New name for the block. Must be non-empty and unique within the slide."
}
}
},
"annotations": {
"title": "Rename Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description95/100
Launch a resolution for a master deck, wait for completion, and return the result. Provide doc_id (the master's SlideDeck.id) and a context mapping variable names to values (str/int/float/bool/date/datetime). Blocks until the resolution reaches COMPLETED, FAILED, or the internal timeout, and returns {resolution_id, status, deck_id, error_message}.
The description explains the capability, when to use it, and what to expect.
Inputs93/100
Input documentation gives an agent enough context to populate the arguments.
doc_id
The ID of the master deck (SlideDeck.id)
Clear enough to supply this argument.
context
Variable name -> value mapping to resolve with. Supports str/int/float/bool/date/datetime. Empty dict resolves with no overrides.
Clear enough to supply this argument.
title
Optional title for the resolved deck. If omitted, the master's title is used.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "resolve_master",
"title": "Resolve Master",
"description": "Launch a resolution for a master deck, wait for completion, and return the result. Provide doc_id (the master's SlideDeck.id) and a context mapping variable names to values (str/int/float/bool/date/datetime). Blocks until the resolution reaches COMPLETED, FAILED, or the internal timeout, and returns {resolution_id, status, deck_id, error_message}.",
"inputSchema": {
"type": "object",
"required": [
"doc_id"
],
"properties": {
"title": {
"type": "string",
"description": "Optional title for the resolved deck. If omitted, the master's title is used."
},
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the master deck (SlideDeck.id)"
},
"context": {
"type": "object",
"description": "Variable name -> value mapping to resolve with. Supports str/int/float/bool/date/datetime. Empty dict resolves with no overrides.",
"additionalProperties": true
}
}
},
"annotations": {
"title": "Resolve Master",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description97/100
Convert an existing single-slide document into a master template. Detects literal filter values that recur across queries and rewrites them as variables. Returns the new master's doc_id, the list of new variable names introduced, and any warnings. The source document is left unchanged.
The description explains the capability, when to use it, and what to expect.
Inputs75/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
doc_id
The ID of the source document (SlideDeck.id) to convert into a master
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "make_master",
"title": "Make Master",
"description": "Convert an existing single-slide document into a master template. Detects literal filter values that recur across queries and rewrites them as variables. Returns the new master's doc_id, the list of new variable names introduced, and any warnings. The source document is left unchanged.",
"inputSchema": {
"type": "object",
"required": [
"doc_id"
],
"properties": {
"doc_id": {
"type": "string",
"format": "uuid",
"description": "The ID of the source document (SlideDeck.id) to convert into a master"
}
}
},
"annotations": {
"title": "Make Master",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description67/100
Export a saved document to HTML, PDF, or Markdown.
Describe the returned information so the agent knows whether it will answer the request.
Inputs78/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
document_id
The document ID
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
format
Output format
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
style_name
Brand style name for rendering. Used for non-DeckSpec documents. DeckSpec documents use their stored style. Defaults to org/fallback style if omitted.
Clear enough to supply this argument.
mode
Chart rendering mode for markdown export: 'image' (default) uploads chart PNGs to storage and embeds presigned URLs; 'table' renders charts as inline markdown tables. Ignored when format is 'html' or 'pdf'.
The title clearly communicates the tool’s action and subject. Keep it concise.
Description75/100
Send feedback about this semantic layer to its admins. Category 'ok'
when a question was answered: the answer, the query, brief comments. A
problem category when the data or docs were missing or misleading, or a
result looked wrong. Name the models, columns, and memories involved. Tool
errors are recorded automatically and need no report.
The description explains the capability, when to use it, and what to expect.
Inputs94/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
user_question
What the user asked, as one sentence.
Clear enough to supply this argument.
category
ok: you answered the question; the body holds the answer, the query that produced it, and brief comments. missing_data: no model, column, or capability holds what was asked for. unclear_docs: a model, column, or memory description is missing, ambiguous, or contradicts the data, or you had to invent a definition yourself. wrong_result: a query ran but the numbers or rows look wrong. other: anything else worth telling the admins.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
body
For 'ok': the answer, the query behind it, and a short comment; keep it minimal. For a problem: what you needed from the layer and what you found instead. A few sentences; enough for an admin to act on.
Clear enough to supply this argument.
related_entities
Models, columns, or memories involved, as 'model', 'model.column', or 'memory:<id>', e.g. ['orders', 'orders.total', 'memory:revenue_units']. Name the memory whose note misled you, not just the data it describes. A name the layer does not have is still recorded, and flagged back to you.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "report_feedback",
"title": "Report Feedback",
"description": "Send feedback about this semantic layer to its admins. Category 'ok'\n when a question was answered: the answer, the query, brief comments. A\n problem category when the data or docs were missing or misleading, or a\n result looked wrong. Name the models, columns, and memories involved. Tool\n errors are recorded automatically and need no report.",
"inputSchema": {
"type": "object",
"required": [
"user_question",
"category",
"body"
],
"properties": {
"body": {
"type": "string",
"description": "For 'ok': the answer, the query behind it, and a short comment; keep it minimal. For a problem: what you needed from the layer and what you found instead. A few sentences; enough for an admin to act on."
},
"category": {
"enum": [
"ok",
"missing_data",
"unclear_docs",
"wrong_result",
"other"
],
"type": "string",
"description": "ok: you answered the question; the body holds the answer, the query that produced it, and brief comments. missing_data: no model, column, or capability holds what was asked for. unclear_docs: a model, column, or memory description is missing, ambiguous, or contradicts the data, or you had to invent a definition yourself. wrong_result: a query ran but the numbers or rows look wrong. other: anything else worth telling the admins."
},
"user_question": {
"type": "string",
"description": "What the user asked, as one sentence."
},
"related_entities": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 20,
"description": "Models, columns, or memories involved, as 'model', 'model.column', or 'memory:<id>', e.g. ['orders', 'orders.total', 'memory:revenue_units']. Name the memory whose note misled you, not just the data it describes. A name the layer does not have is still recorded, and flagged back to you."
}
}
},
"annotations": {
"title": "Report Feedback",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description92/100
Show feedback agents filed for this organization. Without feedback_id,
lists reports newest first; with one, returns that report. Each report links
to the session it was filed in. Problem reports say where the layer fell
short; 'ok' reports show what users asked and got. Editors only.
The description explains the capability, when to use it, and what to expect.
Inputs68/100
5 of 7 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
feedback_id
One report to show in full. List filters are ignored.
Clear enough to supply this argument.
status
Filter by status. Pass null for all. Defaults to null when negative=false.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
category
ok: you answered the question; the body holds the answer, the query that produced it, and brief comments. missing_data: no model, column, or capability holds what was asked for. unclear_docs: a model, column, or memory description is missing, ambiguous, or contradicts the data, or you had to invent a definition yourself. wrong_result: a query ran but the numbers or rows look wrong. other: anything else worth telling the admins.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "show_feedback",
"title": "Show Feedback",
"description": "Show feedback agents filed for this organization. Without feedback_id,\n lists reports newest first; with one, returns that report. Each report links\n to the session it was filed in. Problem reports say where the layer fell\n short; 'ok' reports show what users asked and got. Editors only.",
"inputSchema": {
"type": "object",
"required": [],
"properties": {
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"status": {
"enum": [
"open",
"resolved"
],
"type": "string",
"description": "Filter by status. Pass null for all. Defaults to null when negative=false."
},
"category": {
"enum": [
"ok",
"missing_data",
"unclear_docs",
"wrong_result",
"other"
],
"type": "string",
"description": "ok: you answered the question; the body holds the answer, the query that produced it, and brief comments. missing_data: no model, column, or capability holds what was asked for. unclear_docs: a model, column, or memory description is missing, ambiguous, or contradicts the data, or you had to invent a definition yourself. wrong_result: a query ran but the numbers or rows look wrong. other: anything else worth telling the admins."
},
"negative": {
"type": "boolean",
"description": "true: problems only; false: 'ok' reports only; null: both."
},
"session_id": {
"type": "string",
"format": "uuid",
"description": "Only reports filed in this usage session."
},
"feedback_id": {
"type": "string",
"format": "uuid",
"description": "One report to show in full. List filters are ignored."
}
}
},
"annotations": {
"title": "Show Feedback",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description83/100
Mark a feedback report resolved, or reopen it, after fixing the underlying
models, docs, or memories. Editors only. Pass a short resolution_note saying
what changed.
The description explains the capability, when to use it, and what to expect.
Inputs83/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
feedback_id
The report, from show_feedback.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
status
'resolved' to close, 'open' to reopen.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
The title clearly communicates the tool’s action and subject. Keep it concise.
Description89/100
Show the agent sessions run against this semantic layer: how it is used,
and where it fails. Without an id, lists sessions by most recent activity.
``session_id`` returns one session with its tool calls. ``call_id`` returns one
call with its arguments and its result. Each session carries the feedback filed
in it. Editors only.
The description explains the capability, when to use it, and what to expect.
Inputs58/100
4 of 6 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
session_id
One session with its calls. List filters are ignored.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
call_id
One call in full, from a session's calls or a report's tool_call_id.
Clear enough to supply this argument.
q
Filter by user email, user name, or session title (substring).
Clear enough to supply this argument.
since_hours
Only sessions with a call in the last N hours.
Explain what happens when this optional value is omitted.
offset
Not provided
Missing description. Explain what this value means and how to supply it.
limit
Not provided
Missing description. Explain what this value means and how to supply it.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "show_session",
"title": "Show Agent Sessions",
"description": "Show the agent sessions run against this semantic layer: how it is used,\n and where it fails. Without an id, lists sessions by most recent activity.\n ``session_id`` returns one session with its tool calls. ``call_id`` returns one\n call with its arguments and its result. Each session carries the feedback filed\n in it. Editors only.",
"inputSchema": {
"type": "object",
"required": [],
"properties": {
"q": {
"type": "string",
"description": "Filter by user email, user name, or session title (substring)."
},
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"call_id": {
"type": "string",
"format": "uuid",
"description": "One call in full, from a session's calls or a report's tool_call_id."
},
"session_id": {
"type": "string",
"format": "uuid",
"description": "One session with its calls. List filters are ignored."
},
"since_hours": {
"type": "integer",
"description": "Only sessions with a call in the last N hours."
}
}
},
"annotations": {
"title": "Show Agent Sessions",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
motley setup, tools, quality score, publishing readiness, and alternatives.
How do I add motley to Claude, ChatGPT, or Cursor?
Add motley to Claude, ChatGPT, or Cursor by connecting its remote MCP URL in each client's MCP settings. In Claude, add a custom connector. In ChatGPT, add an MCP app. In Cursor, add an MCP server under Settings. The MCP URL is https://app.motley.ai/api/v1/mcp-directory.
Is motley MCP ready for ChatGPT and Claude?
As of November 27, 2026, motley scores 100/100 on Manufact's MCP publishing checklist. The scan meets ChatGPT publishing checks and meets Claude publishing checks. Passing these checks does not guarantee marketplace approval.
How clear is motley's MCP tool documentation?
As of November 27, 2026, motley scores 77/100 in Manufact's review of tool titles, descriptions, input and output schemas, and behavior annotations. The review covers 28 of 28 discovered tools. The quality score measures documentation clarity; runtime behavior and marketplace readiness require separate checks.
What are the best alternatives to motley?
As of November 28, 2026, alternatives to motley in data-analytics on the Manufact MCP leaderboard include Neon, HYPD AI for Google Analytics, ClickHouse Cloud MCP Server, Polygraph, and athletedata.
How can motley improve its MCP documentation?
update_block is the lowest-scoring reviewed tool at 64/100. No output schema is declared. Add one for structured results so clients can interpret returned fields. Open its review for feedback and a copyable fix prompt, then rerun the documentation review after updating your tool metadata.
Not your MCP?
Review any public or OAuth MCP server for protocol compatibility, tool documentation, and ChatGPT and Claude publishing readiness. No account required.