Motley is a semantic layer for querying your data. Instead of writing SQL, describe what you want with models, measures, dimensions, and filters. New here? Start with inspect(reference='memory:help.intro', entity_type='memory') for an overview of the core concepts and the query shape — it lists the deep-dive topics you can inspect the same way. Use search(question='...') to find relevant models, columns, and saved learnings. Typical workflow: inspect(memory:help.intro) → search → inspect → query. Data sources are managed for you — you do not create or configure them here. When a GitHub config repo is connected, model and memory edits land on your active git branch: list_resources(what='branches') shows it, switch_branch changes it. For every user question call report_feedback: category 'ok' with the question, the answer and the query when you answered it; otherwise say what went wrong so the admins of this semantic layer can fix the setup. A tool error is recorded automatically and needs no report of its own; the question still gets one: 'ok' if you answered without considerable friction, a problem category otherwise. Several reports per session are fine. If the data cannot answer a question reliably, say so rather than guessing.
Protocol
Pass100/10016 / 16 pts
Connection, authentication, and protocol compatibility.
The title clearly communicates the tool’s action and subject. Keep it concise.
Description100/100
Validate a SLayer measure formula or filter expression against a specific model. Returns ``{valid: true}`` or ``{valid: false, error: "..."}`` — call before ``create_model`` / ``edit_model`` (measure formulas, column/model filters) to catch syntax issues without round-tripping to the DB.
The description explains the capability, when to use it, and what to expect.
Inputs92/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
model_name
Name of the model (unique within your workspace).
Clear enough to supply this argument.
kind
``'measure'`` for a measure formula DSL, ``'filter'`` for a row-scope filter DSL.
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.
Description96/100
Validate the workspace's models against their live database schemas and report the minimal set of stale entities (columns, measures, joins, or whole models) whose removal keeps queries valid. Read-only — never mutates. Scopes to one source when a selector is given, otherwise validates every source.
The description explains the capability, when to use it, and what to expect.
Inputs95/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).
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "validate_models",
"title": "Validate Models",
"description": "Validate the workspace's models against their live database schemas and report the minimal set of stale entities (columns, measures, joins, or whole models) whose removal keeps queries valid. Read-only — never mutates. Scopes to one source when a selector is given, otherwise validates every source.",
"inputSchema": {
"type": "object",
"required": [],
"properties": {
"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)."
},
"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": "Validate Models",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description96/100
Recommend the query root model (``source_model``) for a set of ``model.column`` / ``model.measure`` items you want together in one query, plus each item's join path from that root. If no single model reaches every item, returns the best partial roots so you can split the work into a multi-stage query.
The description explains the capability, when to use it, and what to expect.
Inputs95/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.
items
Items to co-locate in one query, each ``model.column`` or ``model.measure``.
Clear enough to supply this argument.
root_hint
Optional intended root model name; honored outright if it can reach every item.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "recommend_root_model",
"title": "Recommend Root Model",
"description": "Recommend the query root model (``source_model``) for a set of ``model.column`` / ``model.measure`` items you want together in one query, plus each item's join path from that root. If no single model reaches every item, returns the best partial roots so you can split the work into a multi-stage query.",
"inputSchema": {
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"type": "string"
},
"description": "Items to co-locate in one query, each ``model.column`` or ``model.measure``."
},
"root_hint": {
"type": "string",
"description": "Optional intended root model name; honored outright if it can reach every item."
},
"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)."
},
"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": "Recommend Root Model",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description75/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``.
The description explains the capability, when to use it, and what to expect.
Inputs94/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.
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
},
"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": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description93/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`` (joins by ``target_model``). Use the inherited source selector only to disambiguate the model when its name is not unique across sources.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs86/100
Explain what happens when this optional value is omitted.
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.
model_name
Name of the model to edit.
Clear enough to supply this argument.
description
New model description.
Clear enough to supply this argument.
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.
meta
Replace the model's free-form ``meta`` dict.
Clear enough to supply this argument.
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 (by ``target_model``); partial updates merge.
Clear enough to supply this argument.
remove
Entities to remove, keyed by ``columns``/``measures``/``aggregations``/``joins`` (joins by target_model).
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`` (joins by ``target_model``). 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 (by ``target_model``); partial updates merge."
},
"hidden": {
"type": "boolean",
"description": "Hide/unhide the model."
},
"remove": {
"type": "object",
"description": "Entities to remove, keyed by ``columns``/``measures``/``aggregations``/``joins`` (joins by target_model).",
"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."
},
"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.
Description85/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`` (``model.<target_model>`` for a ``join``). 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.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs91/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.
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.
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`` (``model.<target_model>`` for a ``join``). 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.
Description78/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.
Inputs90/100
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
source_id
ID of the source to target. Optional when the workspace has a single source.
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
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.
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.
Description99/100
Execute a SLayer query as a scratch/diagnostic lookup and return the
raw rows. Results are NOT persisted — no block is created, no document
is modified. Use this for sanity-checks before authoring chart / table /
query blocks (e.g. "what's the max date in this column?", "how many
distinct categories?", "rough monthly revenue total"). The query shape
is the same SlayerQuery that ``update_query_block`` / ``update_chart_block``
accept — same DSL strings for measures, dimensions, filters; same
``{start_date}`` / ``{end_date}`` filter placeholders and ``time_shift(...)``
patterns for period-over-period. 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.
The description explains the capability, when to use it, and what to expect.
Inputs37/100
60 of 158 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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.
Clear enough to supply this argument.
query › anyOf › 0 › filters
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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 › 0 › order › items › direction
Not provided
Missing description. Explain what this value means and how to supply it.
query › anyOf › 0 › order › items › raw_formula
Internal — captured automatically from expression strings; do not set.
Clear enough to supply this argument.
query › anyOf › 0 › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
Clear enough to supply this argument.
query › anyOf › 0 › offset
Rows to skip.
Clear enough to supply this argument.
query › anyOf › 0 › whole_periods_only
Snap date filters to whole time buckets and drop the current incomplete bucket.
Clear enough to supply this argument.
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(*)`.
Clear enough to supply this argument.
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) | error (refuse).
Clear enough to supply this argument.
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 multi-stage list; other stages reference it as their source_model.
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.
Arity of a join, read source->target ("many orders -> one customer").
Descriptive metadata, orthogonal to ``JoinType`` — it does not change the
emitted join.
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.
Clear enough to supply this argument.
query › anyOf › 1 › items › filters
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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.
Internal — captured automatically from expression strings; do not set.
Clear enough to supply this argument.
query › anyOf › 1 › items › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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) | 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.
Clear enough to supply this argument.
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).
Clear enough to supply this argument.
explain
Run EXPLAIN ANALYZE and return the query plan instead of rows.
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 as a scratch/diagnostic lookup and return the\n raw rows. Results are NOT persisted — no block is created, no document\n is modified. Use this for sanity-checks before authoring chart / table /\n query blocks (e.g. \"what's the max date in this column?\", \"how many\n distinct categories?\", \"rough monthly revenue total\"). The query shape\n is the same SlayerQuery that ``update_query_block`` / ``update_chart_block``\n accept — same DSL strings for measures, dimensions, filters; same\n ``{start_date}`` / ``{end_date}`` filter placeholders and ``time_shift(...)``\n patterns for period-over-period. 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.",
"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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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}'\"`). `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). 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.
Description98/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.
Inputs29/100
57 of 155 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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 › order › items › raw_formula
Internal — captured automatically from expression strings; do not set.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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) | 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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.
Internal — captured automatically from expression strings; do not set.
Clear enough to supply this argument.
query › anyOf › 1 › items › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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) | error (refuse).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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.
Description88/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.
Inputs38/100
31 of 80 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
Name of a deck-level context variable (e.g. 'start_date', 'end_date'). Resolved from the deck's resolution context.
Clear enough to supply this argument.
query › variables › additionalProperties › anyOf › 0 › oneOf › 2 › right › type
Discriminator tag for the delta node. Always 'delta'.
Clear enough to supply this argument.
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.
Clear enough to supply this argument.
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 › column › model
Not provided
Missing description. Explain what this value means and how to supply it.
query › order › items › column › label
Not provided
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 › order › items › raw_formula
Internal — captured automatically from expression strings; do not set.
Clear enough to supply this argument.
query › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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.
Clear enough to supply this argument.
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) | 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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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": false
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description90/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.
Inputs88/100
Explain what happens when this optional value is omitted.
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.
Explain what happens when this optional value is omitted.
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.
Description62/100
Update the template of a text block and resolve it
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs93/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
Clear enough to supply this argument.
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.
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.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "update_text_block",
"title": "Update Text Block",
"description": "Update the template of a text block and resolve it",
"inputSchema": {
"type": "object",
"required": [
"location",
"user_prompt"
],
"properties": {
"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 within the deck",
"additionalProperties": false
},
"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."
},
"allowed_outputs": {
"type": "array",
"items": {
"type": "string"
},
"description": "Allowed outputs for constrained LLM generation (only valid when call_llm=True)"
},
"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."
}
}
},
"annotations": {
"title": "Update Text Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description61/100
Update the template of a table block and resolve it
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs79/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.
user_prompt
The new user prompt for the table 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.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
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 table.
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.
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_table_block",
"title": "Update Table Block",
"description": "Update the template of a table block and resolve it",
"inputSchema": {
"type": "object",
"required": [
"location",
"user_prompt"
],
"properties": {
"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 table."
},
"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 within the deck",
"additionalProperties": false
},
"user_prompt": {
"type": "string",
"description": "The new user prompt for the table 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"
}
]
}
]
},
"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."
}
}
},
"annotations": {
"title": "Update Table Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description72/100
Create or update a chart block from a structured SLayer-format query and chart configuration. Accepts a SlayerQuery (single object or a list of stages) as the query and a ChartDetailsTemplate for styling. Validates the query and renders the chart.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs28/100
69 of 190 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
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 › 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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 › order › items › raw_formula
Internal — captured automatically from expression strings; do not set.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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) | 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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.
Internal — captured automatically from expression strings; do not set.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
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.
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) | 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.
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.
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_chart_block",
"title": "Update Chart Block",
"description": "Create or update a chart block from a structured SLayer-format query and chart configuration. Accepts a SlayerQuery (single object or a list of stages) as the query and a ChartDetailsTemplate for styling. Validates the query and renders the chart.",
"inputSchema": {
"type": "object",
"required": [
"location",
"query",
"chart_details"
],
"properties": {
"query": {
"anyOf": [
{
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name in a multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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}'\"`). `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). For period-over-period comparison, add a measure with a `time_shift(...)` formula (e.g. `time_shift(revenue:sum, -1, year)`)."
},
"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 to update (doc_id, slide_name, block_name).",
"additionalProperties": false
},
"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"
}
},
"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."
}
},
"additionalProperties": false
},
"annotations": {
"title": "Update Chart Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description64/100
Create or update a numerical query from a structured SLayer-format query. Accepts a SlayerQuery (single object or a list of stages) as the query spec. Validates and resolves it.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs31/100
64 of 162 inputs have descriptions. Add descriptions to the missing inputs, including where to obtain IDs and how to supply values.
parent_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.
parent_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.
parent_location › block_name
The name of the block
Explain the meaning of this value, not just its name.
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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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 › order › items › raw_formula
Internal — captured automatically from expression strings; do not set.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 0 › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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) | 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 multi-stage list; other stages reference it as their source_model.
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.
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.
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
Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders.
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.
Internal — captured automatically from expression strings; do not set.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
query › anyOf › 1 › items › limit
Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice).
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(*)`.
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) | error (refuse).
Clear enough to supply this argument.
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'.
Clear enough to supply this argument.
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 query resolution context. Takes priority over the deck's stored parameters.
Clear enough to supply this argument.
max_return_rows
Maximum number of data rows to include in the response preview.
Clear enough to supply this argument.
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.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "update_query_block",
"title": "Update Query Block",
"description": "Create or update a numerical query from a structured SLayer-format query. Accepts a SlayerQuery (single object or a list of stages) as the query spec. Validates and resolves it.",
"inputSchema": {
"type": "object",
"required": [
"parent_location",
"query_name",
"query"
],
"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'."
},
"query": {
"anyOf": [
{
"type": "object",
"required": [
"source_model"
],
"properties": {
"name": {
"type": "string",
"description": "Stage name in a multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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 multi-stage list; other stages reference it as their source_model."
},
"limit": {
"type": "integer",
"description": "Max rows to return. Use only for top-N / 'the single most X' requests — never to trim a plain list (an uncapped MCP response is truncated at 20 rows with an explicit notice)."
},
"order": {
"type": "array",
"items": {
"type": "object",
"required": [
"column"
],
"properties": {
"column": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"model": {
"type": "string"
}
},
"description": "A column reference: bare name or dotted join path (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"direction": {
"type": "string"
},
"raw_formula": {
"type": "string",
"description": "Internal — captured automatically from expression strings; do not set."
}
},
"description": "A sort key: ``column`` is a result column name or an expression string; ``direction`` asc|desc.",
"additionalProperties": false
},
"description": "Sort keys; column is a result column name or an aggregation-bearing expression string."
},
"offset": {
"type": "integer",
"description": "Rows to skip."
},
"filters": {
"type": "array",
"items": {
"type": "string"
},
"description": "Condition strings, AND-ed; each routes automatically to WHERE / HAVING / post-aggregation. May contain aggregations, transforms, and {variable} placeholders."
},
"version": {
"type": "integer"
},
"measures": {
"type": "array",
"items": {
"type": "object",
"required": [
"formula"
],
"properties": {
"meta": {
"type": "object",
"additionalProperties": true
},
"name": {
"type": "string"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
},
"description": "Values to return: aggregation-expression formulas (see the query tool description). A bare name references a saved model measure."
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
{
"type": "object",
"required": [
"expression"
],
"properties": {
"name": {
"type": "string"
},
"expression": {
"type": "string"
}
},
"description": "A dimension computed by an ``expression``; an aggregation inside must carry ``partition_by=`` to fix its grain. Best given an explicit ``name``.",
"additionalProperties": false
}
]
},
"description": "Group-by columns — names / dotted paths, or computed expressions ({\"expression\": ..., \"name\": ...}); one result row per distinct value combination."
},
"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"
],
"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"
},
"primary_key": {
"type": "boolean"
},
"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"
},
"type": {
"enum": [
"TEXT",
"INT",
"DOUBLE",
"BOOLEAN",
"DATE",
"TIMESTAMP",
"UNKNOWN"
],
"type": "string"
},
"label": {
"type": "string"
},
"formula": {
"type": "string"
},
"description": {
"type": "string"
}
},
"description": "A named aggregated value: ``formula`` is an aggregation expression — inline in a query's measures or saved on a model and referenced by bare name. ``name`` sets the result key, referenceable in filters and order by either the name or the formula text."
}
},
"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 (``customers.regions.name``); a short form (``regions.name``) auto-routes when exactly one route exists."
},
"date_range": {
"type": "array",
"items": {
"type": "string"
}
},
"granularity": {
"enum": [
"second",
"minute",
"hour",
"day",
"week",
"week_sunday",
"month",
"quarter",
"year"
],
"type": "string"
}
},
"description": "Group-by on ``dimension`` truncated to ``granularity``; optional ``date_range`` [start, end] (ISO dates)."
},
{
"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)\"."
},
"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) | 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}'\"`). `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). For period-over-period comparison, add a measure with a `time_shift(...)` formula (e.g. `time_shift(revenue:sum, -1, year)`)."
},
"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"
},
"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 query resolution context. Takes priority over the deck's stored parameters.",
"additionalProperties": {
"type": "string"
}
},
"max_return_rows": {
"type": "integer",
"description": "Maximum number of data rows to include in the response preview."
},
"parent_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 query's parent block (doc_id, slide_name, block_name).",
"additionalProperties": false
},
"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."
}
},
"additionalProperties": false
},
"annotations": {
"title": "Update Query Block",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": true
}
}
The title clearly communicates the tool’s action and subject. Keep it concise.
Description96/100
Delete a numerical query from a parent text or table block's queries list. Also removes the corresponding reference from the parent block's template and marks dependent blocks across the deck as out-of-date.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs88/100
Explain the meaning of this value, not just its name.
parent_location › doc_id
The ID of the deck (SlideDeck.id)
Clear enough to supply this argument.
parent_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.
parent_location › block_name
The name of the block
Explain the meaning of this value, not just its name.
query_name
The name of the query to delete from the parent block's queries list.
No output schema is declared. Add one for structured results so clients can interpret returned fields.
Not declared
Original tool metadata
{
"name": "delete_query",
"title": "Delete Query",
"description": "Delete a numerical query from a parent text or table block's queries list. Also removes the corresponding reference from the parent block's template and marks dependent blocks across the deck as out-of-date.",
"inputSchema": {
"type": "object",
"required": [
"parent_location",
"query_name"
],
"properties": {
"query_name": {
"type": "string",
"description": "The name of the query to delete from the parent block's queries list."
},
"parent_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 parent text or table block whose query will be deleted (doc_id, slide_name, block_name=parent block name).",
"additionalProperties": false
}
}
},
"annotations": {
"title": "Delete Query",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"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",
"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.
Description80/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).
Describe the returned information so the agent knows whether it will answer the request.
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.
Description81/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_text_block, update_table_block, and update_chart_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.
Inputs83/100
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
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)
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
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_text_block, update_table_block, and update_chart_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.
Description98/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.
Description91/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.
Describe the returned information so the agent knows whether it will answer the request.
Inputs91/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.
Clear enough to supply this argument.
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.
Description80/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.
Explain mutations, irreversible effects, or prerequisites that matter before calling this tool.
Inputs80/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
Clear enough to supply this argument.
column_links › additionalProperties › model_name
The name of the model that the dimension or measure belongs to
Clear enough to supply this argument.
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.
Description76/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.
Inputs90/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
Clear enough to supply this argument.
location
Zero-based target position for the block. Mutually exclusive with after_block.
Clear enough to supply this argument.
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.
Description86/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, use `delete_query`.
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.
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.
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, use `delete_query`.",
"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).",
"additionalProperties": false
}
}
},
"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.
Inputs75/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.
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.
Inputs83/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
doc_id
The ID of the master deck (SlideDeck.id)
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
context
Variable name -> value mapping to resolve with. Supports str/int/float/bool/date/datetime. Empty dict resolves with no overrides.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
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.
Description71/100
Export a saved document to HTML, PDF, or Markdown.
Describe the returned information so the agent knows whether it will answer the request.
Inputs81/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
Explain the meaning of this value, not just its name.
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.
Description87/100
Tell the admins of this semantic layer how a user's question went. File
one report per question, always with the user's question. Category 'ok'
when you answered it: the answer, the query, brief comments. A problem
category when you could not answer reliably, the data or docs were missing
or misleading, a result looked wrong, or you had to invent a definition the
layer does not state. Name the models, columns, and memories involved. A
tool error is recorded automatically and needs no report of its own; the question
still gets one: 'ok' if you answered without considerable friction, a
problem category otherwise. Several reports per session are fine.
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.
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.
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": "report_feedback",
"title": "Report Feedback",
"description": "Tell the admins of this semantic layer how a user's question went. File\n one report per question, always with the user's question. Category 'ok'\n when you answered it: the answer, the query, brief comments. A problem\n category when you could not answer reliably, the data or docs were missing\n or misleading, a result looked wrong, or you had to invent a definition the\n layer does not state. Name the models, columns, and memories involved. A\n tool error is recorded automatically and needs no report of its own; the question\n still gets one: 'ok' if you answered without considerable friction, a\n problem category otherwise. Several reports per session are fine.",
"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.
Description93/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.
Inputs57/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.
Resolve the mismatch between this description and its schema constraints.
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.
Description85/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.
Inputs67/100
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
feedback_id
The report, from show_feedback.
Clarify units, where to obtain this value, or conventions not already expressed in the schema.
status
'resolved' to close, 'open' to reopen.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
resolution_note
What was changed, for admins and future agents.
Explain what happens when this optional value is omitted.
The title clearly communicates the tool’s action and subject. Keep it concise.
Description87/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.
Describe the returned information so the agent knows whether it will answer the request.
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.
Is motley MCP ready for ChatGPT and Claude?
As of October 15, 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 October 15, 2026, motley scores 79/100 in Manufact's review of tool titles, descriptions, input and output schemas, and behavior annotations. The review covers 35 of 35 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 October 15, 2026, alternatives to motley in data-analytics on the Manufact MCP catalog include Epicure, Newsflash, Point Topic, Pricing Optimizer AI, and StatCite.
How can motley improve its MCP documentation?
update_query_block is the lowest-scoring reviewed tool at 61/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.