Skip to content
Sandadocs

MCP tool reference

Every tool Sanda's MCP server offers, with the scope it needs, its parameters and what it does. Generated from the tool definitions the server runs.

This is every tool Sanda's MCP server can offer an assistant. The names, titles, scopes and parameters below are read from the same tool definitions the server runs, so they cannot drift from what a client sees.

How a credential is offered tools

tools/list returns the tools this credential may use, not every tool. A tool is left off the list, and refused if called anyway, when any of these is true:

  • The credential does not hold the scope. Each tool needs one scope. A wider scope includes a narrower one, so a credential holding sql:write also gets everything sql:run and query:run give. See scopes.
  • The edition does not include it. The Sanda search tools (search_documents and every tool needing search:manage), the Knowledge tools and the streams tools are on Standard and Enterprise.
  • The person behind it is no longer allowed. A privileged scope is honoured only while the person who granted it is an owner or admin.
  • The workspace is closed. Then only the tools that read remain: asking questions, reading and running reports, reading notes, looking up the docs, and seeing connections, streams and spend.

action_status is offered only to a credential that holds a scope one of the held tools needs. See permissions and approvals.

A token created with no extra switches is offered search_fluid, describe_table, run_query, search_documents, search_docs, the four tools that find, read and run reports (list_reports, read_report, run_report and report_history) and, on Standard and Enterprise, preview_stream and the four tools that read Knowledge (search_notes, list_notes, read_note and grep_notes).

Reading an entry

Each entry starts with the tool's name (the string a client sends), then a row of markers: the tool's title, what kind of tool it is, the scope it needs and, where it applies, the editions that include it. The kind comes from the tool's annotations, which a client can use to skip a confirmation prompt or add one:

  • Read only means the tool changes nothing, so calling it again is safe.
  • Writes means the tool changes something.
  • Destructive means the tool can remove or overwrite something, such as taking tables off the map, dropping a view or committing SQL.

The parameter table lists every top-level parameter with its type, whether it is required, and what it means. Where a parameter is an object or a list, its fields are described in the parameter's own text or in the entry's notes.

Limits every tool shares

Limit Value
Rows or hits returned by run_query, run_sql and search_documents At most 50 per answer. run_query pages past that with cursor
Rows in one export_query file 100,000
How long an export_query link opens for 15 minutes
Rows returned by execute_sql 50 by default, at most 500
Rows loaded or added in one load_rows or append_rows call 10,000
Request body 1,000,000 bytes
Time a tool holds a call open when it builds or runs something 55 seconds. A longer job belongs on a schedule
Time a run_query or run_sql statement may run 20 seconds
Held actions a workspace may have waiting 50
Requests one credential may make 300 a minute
How long a task's result is kept 24 hours

A tool that cannot answer returns a sentence and isError: true rather than a failure, for example that two tables would fan out or that a column does not exist. An assistant is expected to read it and try again differently.

Results a program can read

run_query, run_sql and search_documents declare an output schema, and every answer that is not an error carries structuredContent in that shape beside the text a model reads:

Field What it holds
columns The column names, in order
rows One object per row, keyed by column name
row_count How many rows this answer holds
truncated Whether the question had more rows than this answer holds
measures Which columns are numbers the query computed, or null when it does not know
next_cursor For run_query, the cursor for the next page, or null
sql The SQL that ran
refusal Why the question was not run, when Sanda refused it rather than failing, or null

A harness that uses results in code can read these fields instead of parsing the text. To move every row somewhere else, use export_query, which answers with a download link and keeps the rows out of the conversation.

Choose toolsets

A connection holding every permission is offered every tool, and each tool's definition is sent to the model on every turn. A harness doing one job can ask for only the tools it needs, as a comma-separated list in an X-MCP-Toolsets header or a toolsets parameter on the endpoint address:

Text
X-MCP-Toolsets: query,reports
Toolset Tools for
query Asking questions: search_fluid, describe_table, run_query, export_query, search_documents, run_sql, search_docs
model Changing what the semantic model knows
warehouse Views, summaries, procedures, loads and SQL in the warehouse
schedules Scheduling warehouse work
reports Reading, running, building and delivering reports
search Managing Sanda search services
knowledge Reading and writing Knowledge notes
streams Seeing and running streams, and making and changing the stream graphs that join a pull, a task and pushes
workspace Connections, warehouses, syncs and spend

action_status is in every toolset. A toolset only narrows what the connection's permissions already allow, and a tool outside the toolsets asked for is refused with the name of the toolset that has it. A toolset name Sanda does not have is refused rather than ignored. With neither the header nor the parameter, a connection gets every tool its permissions allow, as before. A connected app narrows what it is offered on the consent screen instead, because adding a parameter to the address changes the address it signs in for. Use the header if the app can send one.

Long tools as tasks

run_learn, refresh_view, run_search_build and call_procedure can take longer than a client should wait on one request. A client that declares the io.modelcontextprotocol/tasks extension in its capabilities gets a task back for these instead of waiting: a taskId, a status of working, and how often to ask. It asks with tasks/get until the status is completed, when the task carries the tool's answer exactly as tools/call would have returned it, or failed. tasks/cancel stops a task that has not finished, though a tool already running may still finish its work.

Only the connection that started a task can read it, and a task's result is kept for 24 hours. If the connection is disconnected before the task runs, it does not run. A client that does not declare the extension gets the answer in the same request, as before.

Retry a change safely

A tool that changes something, and would change it again if called twice, takes an optional request_id: a name of your own for one action, such as a UUID. A second call from the same connection with the same request_id is not run. It gets the first call's answer back, or, if the first call is still running, says so. A request_id is remembered for a day, belongs to one tool, and is the connection's own. Use a new one for each new action.

This matters because a client whose connection broke mid-call cannot tell whether the call reached Sanda, and is expected to send it again.

Confirmations

A tool marked Destructive asks the person before it runs, when the client says it can show them a form. The first call comes back asking for confirmation instead of an answer. The client shows the question, and sends the call again with the person's answer. If they decline, nothing is changed. The confirmation counts only for that call, from that connection, for ten minutes. A workspace's own approval rules still apply after it. A client that cannot show a form, such as an agent running unattended, is not asked.

The question also offers Don't ask again. Tick it with Go ahead and that connection runs this tool and every other from then on without asking, so you are asked once rather than on every call. It applies to that one connection (a connected app or an integration token), including a connection made before this option existed, and it never lets the connection do anything its scopes do not already allow. To be asked again, press Ask again beside it under Asked once on Intelligence · Agents. A person signed in to the console is not offered it.

execute_sql in read mode is never asked about, because it runs inside a read-only transaction and cannot change anything.

Resources

Sanda also serves two resources for clients that read them. Both need fluid:read, like search_fluid. A credential without it is listed no resources, and reading one is refused the way a tool is, with a step-up challenge for a connected app:

Resource What it holds
becca://fluid/brief The one-page map of the workspace: its tables and the names of every metric, dimension, filter and category. Read this first
becca://fluid/context Everything in full: every column, expression, sample value and join. Large, so prefer the brief plus tool calls

And three resource templates, for one thing at a time. Each is read through the tool named beside it, needs that tool's permission, and is listed only to a credential that has it:

Template What it holds Read through
becca://table/{name} One table on the map: its columns, key, and the metrics, dimensions and joins it takes part in describe_table
becca://report/{report} One report, block by block read_report
becca://note/{+path} One Knowledge note, and whether a person has verified it read_note

Prompts

Clients that show a server's prompts (Claude Code lists them as slash commands) are offered three ready-made starts. Each is words only: it runs nothing and adds no permission, and it is listed only to a credential that can use the tools it leads to.

Prompt What it asks the assistant to do
answer_a_question Answer a question from the metrics and definitions the workspace agreed on, and say which ones the answer rests on
explain_a_change Compare a metric across two periods and break the difference down by where it came from
build_a_report Build a report on a topic, block by block, after checking one does not already exist

Sam and MCP

Sam, the console's own agent, uses many of these tools too, under the signed-in person's role and the capabilities switched on under Settings · Sam. It is not offered execute_sql, set_intake, append_rows, list_intake_tables, the tools that manage Sanda search, the stream tools listed here, the Knowledge tools, or the tools that copy or delete a report, change when a connection syncs, change or delete a schedule, check or publish a view, refresh a summary, or read spend and the connector catalogue; action_status is for MCP credentials alone. Sam has tools of its own for building reports and learning from your data, which draw on the report open in front of you and show their progress as they go. create_report, edit_report, list_reports, read_report and run_learn share their names with Sam's own, and inside Sam its own answer them. Sam reads back what a report shows with run_report, and undoes its changes with report_history and restore_report, under its reports switch. Sam places a block with place_block, which is never served over MCP; add_block is the MCP tool for the same thing. See Sam.

run_query says how long each question took, and whether a summary answered it. An agent that sees a report's questions are slow can plan summaries for it with list_summaries and keep them with create_summary. warehouse_advice also lists summaries worth keeping for questions that are slow again and again, which create_summary keeps by their finding id, and summaries worth dropping.

Read the semantic model and your data

Find what the workspace has modelled, look closely at a table, ask a question and search the text inside rows.

search_fluid

Search the semantic modelRead onlyfluid:read

Finds what the workspace has modelled: metrics, dimensions, named filters, tables and columns. An assistant calls it before using any name it has not already seen in the workspace brief or an earlier answer, because a metric found here is the definition the business agreed on.

Parameter Type Required Description
query string No A word or fragment to match against names, synonyms, descriptions, definitions and column names. Leave it empty to list everything.
kind string, one of all, metrics, dimensions, filters, tables, columns No Narrows the search to one kind of thing: all (the default), metrics, dimensions, filters, tables or columns.

The answer is text, one line per match. A search that finds nothing says so, which is an answer: try a synonym before concluding the question cannot be asked.

describe_table

Describe a tableRead onlyfluid:read

Describes one table in full: every column with its type, the grain, the primary key, the time column, the metrics and dimensions measured on it and every join it can follow. An assistant calls it before it names a column.

Parameter Type Required Description
table string Yes The table's business name, its schema-qualified relation or its identifier, for example order details, mapping.order_details or order_details. Case and separators do not matter.

A table that is not on the map is not found, and the answer names the closest tables that are.

run_query

Run a composed queryRead onlyquery:run

Answers a question with rows. The assistant names what it wants by reference (metrics, dimensions, filters, conditions) and Sanda composes the SQL, resolves the joins and runs it, so a number means what the workspace says it means. This is the tool for almost every question.

Parameter Type Required Description
metrics array of strings No Metric names from search_fluid. These are the numbers the business has defined.
dimensions array of strings No Dimension names to break the numbers down by.
granularity string, one of day, week, month, quarter, year No How coarsely to group a time dimension: day, week, month, quarter or year. Empty means one row per underlying value.
columns array of objects No Raw columns for questions no metric covers, each as a fully-qualified schema.table.column and an aggregate (sum, avg, min, max, count, count_distinct, or empty to list the value). A well-behaved assistant says when it has leaned on one, because the answer rests on a column name rather than an agreed definition.
filters array of strings No Named filter names from search_fluid: conditions the workspace has already agreed on.
conditions array of objects No Extra narrowing for this question only. Each condition has a field (a dimension name or a fully-qualified column), an op, a list of values and an optional named period in relative. Operators are the same ones the console's filters use.
order_by array of objects No How to sort, first entry first, as by (a metric, dimension or column already in the query) and direction (asc or desc). Left out, a number broken down by a label comes back largest first and a time series in time order.
limit integer No How many rows to return. The default and the maximum are both 50.
cursor string No The next page of a question that had more rows: the next_cursor an earlier answer gave, sent with exactly the same arguments as that call. Leave it out for the first page. A cursor sent with different arguments is refused.

Operators and named periods are listed in filters. The schema marks every key of a condition as required, so send all four: use an empty list for values and an empty string for relative when they do not apply. relative is only for in_range and names a period such as last_month; Sanda resolves it in UTC and states the window it used.

JSON
{
  "metrics": ["net revenue"],
  "dimensions": ["region", "issue date"],
  "granularity": "month",
  "conditions": [
    { "field": "issue date", "op": "in_range", "values": [], "relative": "last_6_months" }
  ],
  "limit": 10
}

The answer is text: a table of rows, the window any named period resolved to, and the SQL Sanda composed. Metrics measured on different tables can be asked for together, and each is counted on its own table, so revenue beside order count counts every order once. Each metric keeps its own condition. Two tables that would fan out if joined come back as a sentence explaining the refusal, not as a wrong number. A column whose name looks like it holds a secret is never returned.

Beside the text, the answer carries the same rows as structured content: see results a program can read. When the question has more rows than one answer holds, the answer ends with a next_cursor. Send it as cursor with the same arguments for the next page. A plain listing with no order_by and no metric has no order to page by, so its answer says to add order_by instead.

search_documents

Search the text inside the rowsRead onlyquery:runStandard · Enterprise

Finds rows by what their text says, for questions about wording rather than about a number, such as which invoices mention water damage. It searches meaning and words together and answers with rows and never a total.

Parameter Type Required Description
query string Yes What to look for, in words. A phrase or a sentence works better than a keyword, because meaning is half of how this searches.
service string No Which search service to search, by name. Leave it out when the workspace has only one.
k integer No How many rows to return. The default is 10 and the maximum is 50.
filters array of objects No Narrows the search by a service's attribute columns, each as column, op (eq, neq, in, contains, gt, gte, lt, lte) and value. Only columns the service declares as attributes can be filtered.

Every hit carries the value of its table's key column. To turn hits into a number, take those keys and call run_query with a condition on them.

This is a question of the data, so it needs only query:run, and it is offered to any client holding that scope on an edition with Sanda search (Standard and Enterprise). If the workspace has no search service yet, a call answers that there is nothing to search. Managing services is a separate, privileged scope (search:manage).

run_sql

Run SQL you wroteRead onlysql:run

Runs one read-only SELECT the assistant wrote itself. It is the fallback for a question run_query cannot express, such as a window function or a cohort. It bypasses the workspace's own definitions, so the number is the assistant's rather than the business's.

Parameter Type Required Description
sql string Yes One PostgreSQL SELECT (a leading WITH is fine). No semicolon, no comments, no DDL or DML. Every relation must be one describe_table listed.
why string Yes One sentence naming what run_query could not express. It is required, and a client is expected to show it to the person beside the answer.

Runs through the reader role inside a read-only transaction, returns at most 50 rows and stops after 20 seconds. A column whose name looks like a credential or an identity number is refused, whatever the statement calls it.

A default integration token does not see this tool at all: it is listed only for credentials granted sql:run. Sam is offered it only when its sql capability is switched on under Settings · Sam.

export_query

Export every row of a questionRead onlyquery:run

Gets every row of a question as a CSV file, without the rows passing through the conversation. It takes the same question as run_query and answers with a download link.

Parameter Type Required Description
metrics array of strings No Metric names from search_fluid, as for run_query.
dimensions array of strings No Dimension names to break the numbers down by, as for run_query.
granularity string, one of day, week, month, quarter, year No How coarsely to group a time dimension, as for run_query.
columns array of objects No Raw columns for questions no metric covers, as for run_query.
filters array of strings No Named filter names, as for run_query.
conditions array of objects No Extra narrowing for this question only, as for run_query.
order_by array of objects No How to sort the file, as for run_query.

The link runs the question when it is opened and returns every row with every value at full length, up to the row limit in limits every tool shares. It works for the time that table gives. Anyone holding the link can open it in that time, so an assistant should pass it only to whoever needs the file. Opening it checks the connection that made it again: a connection disconnected, or no longer allowed to ask questions, refuses the download.

Nothing is stored. The rows go from your warehouse to whoever opens the link, so the file is never kept anywhere outside your workspace's region. Text that a spreadsheet would read as a formula is written with a leading apostrophe, so opening the file runs nothing.

Only a connected app or an integration token can make a link. In the console, a table on a report downloads its rows as CSV.

search_docs

Search the Sanda docsRead onlyfluid:read

Searches Sanda's own documentation at docs.sanda-os.com.au for how the product works and how to do something in it. An assistant calls it for a question about Sanda, never for a question about your data, and gives you the link it used.

Parameter Type Required Description
query string Yes What to look for, in a few words, for example connect xero, incremental sync or invite a member.
limit integer No How many sections to return, from 1 to 5. The default is 3.

The answer is text: for each match, the page and section title, the address of the section, and the section's own words. A search that finds nothing says so and points at the docs site.

This reads public pages and nothing of the workspace's data, so it needs only fluid:read, and a call is never held for approval. It makes no model call, so it costs nothing on the AI limit. Sam uses it too, to answer how-to questions with a link.

See and refresh the workspace

Check which connections and warehouses exist, how fresh and how full they are, and start a sync.

list_connections

List connectionsRead onlyworkspace:read

Lists every data connection in the workspace: the system it pulls from, its health, when it last synced, how many rows it has landed, its schedule and where it lands. An assistant uses it to answer whether the data is fresh.

Takes no parameters.

Never returns a credential.

connection_status

One connection, in detailRead onlyworkspace:read

Shows one connection's last ten runs with status, rows, duration and any error text, and the dataset its rows became. While a sync is running it also reports the stage, rows read so far, the average rate and each table's state.

Parameter Type Required Description
connection string Yes The connection's name or id, from list_connections.

list_warehouses

List warehousesRead onlyworkspace:read

Lists each warehouse with its storage against its limit, compute, table and row counts, and whether ingest is paused. An assistant uses it before a large load to check how much room is left.

Takes no parameters.

Never returns a connection string.

sync_now

Start a syncWritesworkspace:manage

Starts one connection's sync now instead of waiting for its schedule. The rows land in the background, and connection_status shows how far the run has got.

Parameter Type Required Description
connection string Yes The connection's name or id, from list_connections.

A sync reads from the source system and lands rows in the warehouse, so it costs compute like any other sync. set_sync_schedule changes when a connection syncs on its own.

set_sync_schedule

Change when a connection syncsWritesworkspace:manage

Sets when one connection syncs on its own, or leaves it to sync only when started. Syncs run on the quarter hour, so the minute must be 0, 15, 30 or 45.

Parameter Type Required Description
connection string Yes The connection's name or id, from list_connections.
cron string Yes A five-field cron on the quarter hour, for example 0 6 * * * for 6am every day. An empty string means the connection syncs only when sync_now or a person starts it.
timezone string No An IANA zone the cron is local to, for example Australia/Sydney. It stays on local time across daylight saving, which only a daily or weekly cron can do. Leave it out and the cron is UTC.

Needs workspace:manage, which only an owner or admin can grant. list_connections shows each connection's schedule. See schedules.

spend_summary

What the workspace has spentRead onlyworkspace:read

Says what this month has cost so far and is on course to cost, by service (compute, storage, AI, syncs, streams and the edition's fee), each warehouse's share, the same point last month, and the AI used today against the daily AI limit.

Takes no parameters.

The figures are what the workspace pays, in AUD, and match Settings · Spend in the console. An assistant can read them before something that spends, such as a large search index, a learning pass or a materialized view. See spend.

list_connectors

What can be connectedRead onlyworkspace:read

Lists the systems the workspace can connect: the sources a pull reads and the destinations a push writes to, as far as they are switched on where your workspace runs, and the apps and databases a connection syncs. Names and keys only.

Parameter Type Required Description
query string No A name, or part of one, to look for, for example xero. Leave it out to list everything.

Setting a system up needs its credentials, which a person types into the console and never into a tool call. Pulls and pushes are part of Streams, on Standard and Enterprise; the answer says so on Basic. See connections and streams.

Write the semantic model

Put landed tables on the map, define metrics, dimensions, filters and relationships, and review what Sanda proposed. Definitions go live at once.

list_warehouse_tables

List tables in the warehouseRead onlyfluid:write

Lists every table that has landed in the warehouse, with its columns, a row estimate and whether it is already on the semantic map. This is the raw layer describe_table cannot see, and the first step before import_tables.

Parameter Type Required Description
only string No One schema-qualified relation to describe on its own, for example raw.xero__invoices. Leave it empty to list them all.

import_tables

Put warehouse tables on the mapWritesfluid:write

Puts landed tables on the semantic map so the semantic model can query them. Sanda reads each table's shape, publishes a view over the columns chosen and files it under its connector's dataset, then reports the kind, key and time column it guessed and the joins it drew.

Parameter Type Required Description
relations array of strings Yes Schema-qualified relations to add, for example raw.xero__invoices, from list_warehouse_tables. Up to 60 at a time.
columns object No Optional. For each relation, the column names to keep. The key and time columns are always kept. Leave a relation out to take every column.
kinds object No Optional. For each relation, fact or dimension, when the caller already knows. A fact records things that happened (orders, invoices) and a dimension records things that are (products, customers). This overrides Sanda's guess.
relationships string, one of infer, none No infer (the default) draws joins that the column names assert, such as a column named exactly like another table's key. none draws none. Ambiguous matches are reported and never drawn.

Importing a table that is already on the map refreshes it and does not duplicate it. Nothing here changes the rows in the warehouse.

set_table_kind

Mark a table as a fact or a dimensionWritesfluid:write

Says whether a table on the map is a fact or a dimension. Getting this right is what stops a query summing a price list. An assistant calls it after import_tables when Sanda's guess was wrong.

Parameter Type Required Description
table string Yes The table as the semantic model names it, its relation or its identifier. Case and separators do not matter.
kind string, one of fact, dimension Yes fact or dimension.

retire_tables

Take tables off the mapDestructivefluid:write

Takes tables off the semantic map. The rows in the warehouse are untouched, but every metric, dimension, filter and relationship written against those tables goes with them.

Parameter Type Required Description
tables array of strings Yes Business names, relations or identifiers, as import_tables named them.

Destructive to the model, not to the data. A well-behaved assistant reads the table names back to the person before calling it. Sam always asks first, whatever its mode.

define

Define something in the semantic modelWritesfluid:write

Creates or replaces one definition in the semantic model, live at once: a metric, dimension, filter, relationship, alias, category or dataset, or a statement of what a table already on the map means.

Parameter Type Required Description
kind string, one of metric, dimension, filter, relationship, alias, category, dataset, table Yes What to define: metric, dimension, filter, relationship, alias, category, dataset or table.
definition object Yes The fields for that kind, as an object. Each kind's fields are listed in the notes below.

A definition with the same name replaces the old one, and names are matched without regard to case. The reply names the table the definition landed on and says if an expression uses a column that table does not have.

Kind Fields
metric name, table, expression (one SQL fragment over that table's own columns, for example sum(total_ex_gst)), and optionally aggregation (sum, avg, count, count_distinct, min, max, ratio, custom), filters, unit, format (currency, percent, integer, decimal, duration; a percent metric returns a fraction, 0.72 shown as 72%, so an expression that multiplies by 100 is refused for it), description, synonyms
dimension name, column (as schema.table.column), and optionally kind (categorical, time, geo, boolean, numeric), description, synonyms
filter name, table, expression (a named WHERE condition), optionally description
relationship left_column, right_column, key (the business name of the shared identity), optionally left_cardinality, right_cardinality (one or many), description
alias column, term, optionally description
category name, optionally description
dataset name, optionally description
table table, and any of description, grain, primary_key, time_column, kind, name. Only the fields given change
JSON
{
  "kind": "metric",
  "definition": {
    "name": "net revenue",
    "table": "invoices",
    "expression": "sum(total_ex_gst)",
    "format": "currency",
    "synonyms": ["turnover"]
  }
}

list_proposals

List proposals awaiting reviewRead onlyfluid:write

Lists everything Sanda's own learning pass has proposed and nobody has signed off: tables, metrics, dimensions, filters and relationships. Proposals are invisible to queries until they are accepted.

Takes no parameters.

review_proposal

Accept or reject a proposalWritesfluid:write

Accepts or rejects one proposal. An accept may carry corrections, so a nearly right proposal is one call. A relationship is decided on both sides together.

Parameter Type Required Description
kind string, one of metric, dimension, filter, mapping, table, category, dataset, glue Yes What is being reviewed: metric, dimension, filter, mapping, table, category, dataset or glue.
id string Yes The proposal's id, from list_proposals.
action string, one of accept, reject Yes accept or reject.
edits object No Optional corrections applied when accepting, in the same shape define takes for that kind.

Accept a relationship's tables before the relationship.

run_learn

Learn from the warehouseWritesfluid:write

Runs learn from my data: Sanda reads the tables that have landed, with a few sample values from each column, and files tables, metrics, dimensions, mappings and relationships as proposals. Nothing goes live until it is accepted.

Parameter Type Required Description
connection string No Learn only what one connection landed, by name or id from list_connections. Leave it out for the whole warehouse.
samples boolean No false to send only the tables' structure and no sample values. Defaults to true, which proposes better metrics.

list_proposals lists what it proposed and review_proposal accepts or rejects each. No sample is read from a column whose name says it holds a secret. A pass counts against the workspace's daily AI limit and can take a few minutes on a large warehouse, so where there are several sources, learn one connection per call. Sam runs learn from my data too, a connection at a time, when you ask it to. See learn from my data.

delete_definition

Delete a definitionDestructivefluid:write

Removes one metric, dimension, filter, mapping, category, dataset or glue definition from the semantic model for good. Redefining with define is better than deleting and recreating, because a delete loses the definition's history.

Parameter Type Required Description
kind string, one of metric, dimension, filter, mapping, category, dataset, glue Yes What to remove: metric, dimension, filter, mapping, category, dataset or glue. Use retire_tables for a table.
id string Yes The definition's id.

Sam always asks first, whatever its mode.

Load and change warehouse data

Land tables of an agent's own rows, add rows to tables opened for intake, and run one committed SQL statement of its own.

load_rows

Load rows into the warehouseWriteswarehouse:write

Lands a table of an agent's own rows in the warehouse as raw.csv__<table>, through the same loader and storage limit a sync uses. Typical uses are a forecast it computed or a lookup it was given. It cannot touch a table a sync landed.

Parameter Type Required Description
table string Yes A short name. It becomes raw.csv__<name>, lower-cased with underscores.
columns array of objects Yes The columns in order, each with a name and an optional type (text, bigint, integer, numeric, boolean, date, timestamptz or jsonb). Leave the type empty to infer it from the values. Up to 250 columns.
rows array of anys Yes The rows, each either a list of values in column order or an object keyed by column name. Empty cells are null. Up to 10,000 rows per call.
mode string, one of replace, append No replace (the default) swaps the table for the new rows, in their new shape, and keeps the views built on it. It is refused, naming the view, when one of your own views reads a column the new rows drop or retype. append adds to it and must match its columns.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.
import boolean No When true, also puts the table on the semantic map so run_query can reach it.
intake boolean No When true, also opens the table for intake, so credentials holding warehouse:append may add rows to it.

Send rows: [] with declared types to create an empty table. For more than 10,000 rows, append in batches.

JSON
{
  "table": "sales forecast",
  "columns": [{ "name": "month", "type": "date" }, { "name": "forecast", "type": "numeric" }],
  "rows": [["2026-10-01", 125000], ["2026-11-01", 131500]],
  "import": true
}

set_intake

Open or close a table for intakeWriteswarehouse:write

Opens a hand-loaded table for intake, or closes it. While a table is open, credentials holding warehouse:append may add rows to it and do nothing else. Closing leaves the rows and the map as they are.

Parameter Type Required Description
table string Yes The table as load_rows named it. dad habits, csv__dad_habits and raw.csv__dad_habits are one table.
open boolean Yes true opens the table, false closes it.
note string No Optional. What the table is for, shown beside it in the Intake tables panel of Settings · Integrations.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

The shape for a log a person keeps by talking to an assistant: land the table once with load_rows, open it here, then give the person a credential holding only warehouse:append. Not offered to Sam.

append_rows

Add rows to an intake tableWriteswarehouse:append

Adds rows to a table an owner or admin has opened for intake. It only ever appends: it cannot create, replace or delete a table, and a table that is not open refuses.

Parameter Type Required Description
table string Yes The table, as it was opened for intake.
columns array of strings No Only when rows are lists: the column names in the order the values come.
rows array of anys Yes The rows, each an object keyed by column name or a list in columns order. Send an empty list to be told the table's columns and types. Up to 10,000 rows per call.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Send dates as YYYY-MM-DD, numbers as numbers and booleans as true or false, and leave a field out (or null) when the value is not known: a column a row leaves out is stored empty, and the reply lists those columns. A column the table doesn't have is refused. If the same day is told twice, append a second row and let the workspace's model decide which counts.

Appending never changes a column's type. Each value is cast to the column it lands in, and a value the column cannot hold (7.5 in a whole-number column, maybe in a true-or-false one) refuses the whole call, so nothing is added. The reply lists the table's columns with their types as the warehouse stores them, the same list rows: [] gives.

This is the one write any member may grant, because its reach is only the tables an owner or admin has opened. Not offered to Sam.

JSON
{
  "table": "daily log",
  "rows": [{ "day": "2026-09-30", "steps": 8200, "note": "Long walk" }]
}

list_intake_tables

List the tables open for intakeRead onlywarehouse:append

Lists the tables open for intake, which append_rows may add rows to: each one's name, the warehouse it is in, what it is for and when it was opened.

Parameter Type Required Description
warehouse string No Only one warehouse's tables, by name or id, when the workspace has more than one.

Needs warehouse:append, the scope an intake credential holds. Send append_rows an empty rows list to learn a table's columns before the first row. An owner or admin opens and closes tables for intake; see let an assistant add rows.

execute_sql

Run and commit SQL you wroteDestructivesql:write

Runs one SQL statement the agent wrote on a warehouse, as the warehouse's builder role, and commits it. The builder reads every landing table and writes only in the derived schema. This is the SQL shell held by a machine, and there is no undo.

Parameter Type Required Description
sql string Yes Exactly one PostgreSQL statement. Semicolons inside a string are fine and a second statement is refused. Qualify every relation with its schema (raw., derived. or mapping.).
why string Yes One sentence on what the statement is for. It is required and is kept in the audit trail beside the statement.
mode string, one of write, read No write (the default) runs and commits the statement. read runs it inside a read-only transaction the database enforces, for looking before deciding.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.
rows integer No How many rows to return from a statement that returns rows. The default is 50 and the maximum is 500.

A sync's landing tables, a published mapping view, the search indexes and Sanda's own bookkeeping are out of reach whatever the statement says. A statement that changes rows answers with its command tag and the number of rows touched.

When the workspace asks for approval before an agent acts, a write-mode call is held for an owner or admin and does not run until one approves it. A read call is never held. See permissions and approvals. Not offered to Sam.

Views and procedures

Define, build and tune views, materialized views and procedures in the derived schema of a warehouse.

list_sources

List what a view may be built onRead onlywarehouse:model

Lists every relation in a warehouse that a view may be built on, with columns and types: landing tables, derived objects already defined, and the mapping tables. It is read as the role that would own the view, so it lists exactly what a CREATE will accept.

Parameter Type Required Description
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

A published mapping.* view is not listed and cannot be built on. Build on the table behind it.

list_views

List derived views and proceduresRead onlywarehouse:model

Lists every view, materialized view and procedure the workspace has defined in a warehouse's derived schema: its definition, its version, when a materialized view was last built and whether it is on the semantic map.

Parameter Type Required Description
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

create_view

Define a view or materialized viewWriteswarehouse:model

Defines a view in the derived schema from one SELECT over anything list_sources names. A materialized view stores its result and is built now, on the workspace's compute. The view goes on the semantic map in the same call unless told not to.

Parameter Type Required Description
name string Yes A lowercase identifier. It becomes derived.<name>.
sql string Yes One SELECT (or WITH ... SELECT) over the relations list_sources names, by schema-qualified name. One statement, no semicolons, no comments.
materialized boolean No When true, stores the rows and rebuilds them on refresh, instead of computing on every read.
unique_key array of strings No Materialized views only: the columns that identify one row, so a refresh can run without blocking readers.
description string No What the view is for, in a sentence.
replace boolean No When true, redefines derived.<name> if it already exists.
publish boolean No Whether to put the view on the semantic map. The default is true.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

A materialized view's build runs on the workspace's compute and is billed to it, which is why the scope that allows this is privileged. See usage.

refresh_view

Rebuild a materialized viewWriteswarehouse:model

Rebuilds one materialized view now and reports how long it ran and what it cost. An assistant calls it after the tables behind the view have synced.

Parameter Type Required Description
name string Yes The materialized view's name, from list_views.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Runs for up to 55 seconds inside the call. A build that needs longer, up to 14 minutes, belongs on a schedule.

drop_view

Drop a derived objectDestructivewarehouse:model

Drops one view, materialized view or procedure from the derived schema, taking it off the semantic map first. It is refused while another derived view reads it, because Sanda never cascades. The definition stays in the history and the rows do not.

Parameter Type Required Description
name string Yes The object's name, from list_views.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

When the workspace asks for approval before an agent acts, this call is held for an owner or admin. See permissions and approvals. Sam always asks first, whatever its mode.

preview_view

Check a SELECT before defining a viewRead onlywarehouse:model

Checks one SELECT as the role a view would be owned by, before create_view builds it: whether it runs, and the columns a view of it would have, by name and type. It never returns rows.

Parameter Type Required Description
sql string Yes One SELECT (or WITH … SELECT) over the relations list_sources names, by schema-qualified name. No semicolons and no comments.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Reading a table's rows takes run_sql or execute_sql, which say what they read. A column name used twice is pointed out, because a view needs each name once. Owners and admins only, as the console's own preview is.

publish_view

Put a derived view on the mapWriteswarehouse:model

Puts a view or materialized view in the derived schema on the semantic map, so run_query and describe_table can reach it. The same as create_view with publish, for one defined without it.

Parameter Type Required Description
name string Yes The view's name, from list_views.
columns array of strings No The columns to put on the map. Leave it out for every column.
kind string, one of fact, dimension No fact or dimension, when you already know. Leave it out for Sanda's guess.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

To take a view off the map, use retire_tables; drop_view removes it from the warehouse. A procedure cannot be put on the map.

list_summaries

List summaries, or plan them for a reportRead onlyworkspace:read

Lists the summaries kept in the workspace: smaller copies of a table's numbers that reports, run_query and OData read instead of the table when they give exactly the same answer. Each comes with what it covers, whether it is fresh, its rows and how often it has answered. Give a report to see what Sanda would keep to speed it up: the fewest small summaries answering its blocks, roughly how many rows each would be, and why any block stays with the table.

Parameter Type Required Description
report string No A report, by id or exact name, to plan summaries for. Planning needs an owner's or admin's credential; the list does not.

Planning counts the rows each summary would hold, one read of its table each. See summaries.

create_summary

Keep summaries for a reportWriteswarehouse:model

Builds the summaries list_summaries planned for a report, or the one a warehouse_advice finding recommends. Each one is checked against the blocks or questions it was made for, both ways and cell for cell, before anything reads it, and dropped again if any answer differs. A summary is built again after every landing for as long as it is kept, on the workspace's compute.

Parameter Type Required Description
report string No The report, by id or exact name, whose summaries to keep. Give this or finding.
finding string No A summary:keep: finding id from warehouse_advice, to keep the summary it recommends for questions that are slow again and again or read often.
warehouse string No Which warehouse a finding is on, by name or id, when the workspace has more than one.

Owners and admins only. When the workspace asks for approval before an agent acts, this call is held for an owner or admin. See permissions and approvals. Sam always asks first, whatever its mode, and its card says roughly how many rows it would keep.

drop_summary

Drop a summaryDestructivewarehouse:model

Drops one summary. Reports that read it read the table again, which is slower and gives the same answers. Its record stays, retired, with its builds.

Parameter Type Required Description
summary string Yes The summary, by its twelve-character name or its id, from list_summaries.

Owners and admins only. When the workspace asks for approval before an agent acts, this call is held for an owner or admin. See permissions and approvals. Sam always asks first, whatever its mode.

refresh_summary

Bring a summary up to dateWriteswarehouse:model

Brings one summary up to date now. By default it queues a pass that builds the summary again only if something it reads has changed; rebuild builds it again now, inside the call, whatever has changed.

Parameter Type Required Description
summary string Yes The summary, by its twelve-character name or its id, from list_summaries.
rebuild boolean No true to build it again now, inside this call, on the workspace's compute.

A summary is built again after every landing on its own, so this is for one list_summaries says is stale. A pass runs only over a healthy warehouse with a summary ready, and the answer says when nothing could be queued; for a summary that failed, use rebuild. Owners and admins only. See summaries.

create_procedure

Define a procedureWriteswarehouse:model

Defines a procedure in the derived schema: a multi-step transform in plpgsql or SQL that builds, merges or reshapes derived tables, with COMMIT allowed between steps. It runs as the warehouse's builder role.

Parameter Type Required Description
name string Yes A lowercase identifier. It becomes derived.<name>.
body string Yes The procedure body: the plpgsql block, or the SQL statements.
args string No The arguments as name type, name type, for example since date, region text. Empty for none. Types are text, integer, bigint, numeric, boolean, date, timestamptz, timestamp, interval, jsonb and uuid.
language string, one of plpgsql, sql No plpgsql or sql.
description string No What the procedure does, in a sentence.
replace boolean No When true, redefines derived.<name> if it already exists.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

The builder role may read landing tables, derived objects and the mapping tables, and may create and write only in derived. It cannot write a row anywhere else, whatever the body says. Run it with call_procedure.

call_procedure

Run a procedureWriteswarehouse:model

Runs one procedure now, with its arguments in declared order, and reports how long it ran and what it cost.

Parameter Type Required Description
name string Yes The procedure's name, from list_views.
args array of anys No Argument values in declared order. Leave it out for a procedure with none.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Runs for up to 55 seconds inside the call. A run that needs longer belongs on a schedule.

warehouse_advice

What is slowing this warehouse downRead onlywarehouse:model

Reads a warehouse's own statistics and says what is slowing it down or costing it storage: a missing index, a table autovacuum has fallen behind on, stale statistics after a sync, an unused index, storage a rewrite would give back, or a table large enough to partition. It also lists summaries worth keeping for questions that are slow again and again or read often, and summaries nothing reads or whose refresh is stuck. It writes nothing.

Parameter Type Required Description
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Each finding carries an id, the figures behind it and the statement Sanda would run. A finding with no statement is one Sanda will not act on, and it says why. Pass the ids you want acted on to optimise_warehouse. A summary to keep is kept with create_summary and its finding, and one to drop with drop_summary: both always ask a person first. A finding someone dismissed on the Optimise page is not listed. See recommendations.

optimise_warehouse

Apply what the advice foundWriteswarehouse:model

Runs the findings you name by id from warehouse_advice: a vacuum, an analyse, an index created or dropped. Sanda re-reads the warehouse first and runs only findings that are still current. It never runs SQL you send it.

Parameter Type Required Description
ids array of strings Yes Finding ids from warehouse_advice, for example vacuum:raw.xero__invoices. Up to eight at a time.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Each statement runs on the workspace's compute, is recorded on the run ledger and is billed as the seconds it takes. A finding that would lock a table against readers says so in the advice, so read it before sending its id. It rebuilds a summary when asked, and answers a summary to keep or drop by pointing at create_summary or drop_summary.

Schedules

Run views and procedures on a clock or after a sync, and read what each run did and cost.

list_schedules

List schedulesRead onlywarehouse:model

Lists every task graph in a warehouse: its steps, its cadence, whether it is paused or has suspended itself after failures, when it next runs and how its last run went.

Parameter Type Required Description
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

create_schedule

Schedule a task graphWriteswarehouse:model

Defines a task graph: an ordered list of steps on the warehouse, each a materialized view to refresh or a procedure to call, and when it runs. Steps run in order, and a step is skipped when the one before it failed.

Parameter Type Required Description
name string Yes A name for the graph, for example nightly rebuild.
tasks array of objects Yes The steps in order, from one to 20. Each is { "refresh": "view_name" } or { "call": "procedure_name", "args": [ ... ] }, with an optional step name.
cron string No A five-field cron expression evaluated in UTC. Sanda's scheduler runs on a 15 minute grid, so the minute field must be 0, 15, 30 or 45. Leave it out for a graph that runs only after a sync or by hand.
timezone string No The zone the cron was written for, kept for display. Evaluation is always UTC.
after_sync string No A connection, by name or id. The graph runs each time that connection lands rows, which is usually the better trigger. It may be combined with cron. A pull is not a connection: to run a task each time a pull lands, join the two with create_stream_graph.
suspend_after_failures integer No Pause the graph after this many failures in a row, from 1 to 100. The default is 3 and 0 never pauses.
description string No What the graph is for, in a sentence.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

One run has at most 14 minutes, and every run is billed as the seconds its statements executed.

JSON
{
  "name": "nightly rebuild",
  "tasks": [{ "refresh": "revenue_by_month" }, { "call": "close_month", "args": ["2026-09-01"] }],
  "cron": "0 18 * * 1-5"
}

That cron is weekdays at 18:00 UTC.

run_now

Run a task graph nowWriteswarehouse:model

Queues one task graph to run now rather than waiting for its schedule. Because the scheduler runs on a 15 minute grid, it starts at the next quarter hour. A graph already queued or running is not queued again.

Parameter Type Required Description
name string Yes The graph's name, from list_schedules.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

pause_schedule

Pause or resume a task graphWriteswarehouse:model

Pauses a task graph so nothing fires it (not its schedule, not a sync landing, not run_now), or resumes one that is paused or has suspended itself. Resuming resets its failure count.

Parameter Type Required Description
name string Yes The graph's name, from list_schedules.
resume boolean No true to resume. Leave it out or set it to false to pause.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

update_schedule

Change a task graphWriteswarehouse:model

Changes a task graph that already exists: its name, its steps, when it runs, or how many failures in a row pause it. Only what is given changes.

Parameter Type Required Description
name string Yes The graph's name, from list_schedules.
rename string No A new name for it.
description string No A new description. An empty string clears it.
tasks array of objects No The whole new list of steps, in order, in the shape create_schedule takes: {"refresh": "view"} or {"call": "procedure", "args": [...]}. Leave it out to keep the steps.
cron string No A five-field cron in UTC on the quarter hour (minute 0, 15, 30 or 45). An empty string takes the graph off the clock.
timezone string No The zone the cron was written for, for display. Evaluation is UTC.
after_sync string No A connection, by name or id, whose landing runs the graph. An empty string clears it.
suspend_after_failures integer No Pause the graph after this many failures in a row. 0 never pauses.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

pause_schedule pauses and resumes a graph. See tasks.

delete_schedule

Delete a task graphDestructivewarehouse:model

Deletes a task graph: its steps and its cadence go, and the record of every run it made stays. The views and procedures it ran are untouched.

Parameter Type Required Description
name string Yes The graph's name, from list_schedules.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Refused while a stream graph models its pull with it, because that stream graph would then send its pull's rows unmodelled. When the workspace asks for approval before an agent acts, this call is held for an owner or admin. See permissions and approvals. pause_schedule is the way to stop one for a while.

run_history

Run historyRead onlywarehouse:model

Shows what ran and what it cost: the recent runs of one task graph with each step's outcome and seconds, or the versions, builds and calls of one derived view or procedure.

Parameter Type Required Description
schedule string No A task graph, by name, to see its runs.
view string No A derived object, by name, to see its versions and runs. Give one of schedule or view.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Create, change, build and remove search services over tables on the map, and estimate what indexing costs first.

list_search_services

List search servicesRead onlysearch:manageStandard · Enterprise

Lists every Sanda search service in a warehouse: the table and columns it indexes, how many rows and how large the index is, when it last built and what that cost. It also says whether Sanda search is switched on for the workspace at all.

Parameter Type Required Description
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

The search tools are available on Standard and Enterprise. Not offered to Sam.

describe_search_service

Describe a search serviceRead onlysearch:manageStandard · Enterprise

Describes one search service in full: its definition and state, every build with the rows it embedded and what it cost, and every version its definition has had. An assistant uses it to find out why a service is broken.

Parameter Type Required Description
name string Yes The service, by name.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

estimate_search_build

Estimate what indexing would costRead onlysearch:manageStandard · Enterprise

Estimates what indexing a table would cost before anything is created: rows, tokens, dollars and how that compares with the workspace's daily AI limit.

Parameter Type Required Description
source string Yes The table on the map, as mapping.<table>.
text_columns array of strings Yes The columns whose text would be indexed.
key_column string No The column that identifies a row.
model string No The embedding model to use. Leave it out for Sanda's default.
chunk_chars integer No How much text one indexed piece holds.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

create_search_service refuses without confirm: true when a build would use more than half a day's AI limit. This is how to know that in advance.

create_search_service

Create a search serviceWritessearch:manageStandard · Enterprise

Indexes the text of a table so it can be searched by meaning as well as by words. The first build sends the text of the columns named to an embedding model outside your data region and is charged against the workspace's daily AI limit.

Parameter Type Required Description
name string Yes A lowercase name for the service. It becomes a table in the warehouse.
source string Yes A table on the semantic map, as mapping.<table>. A view in the derived layer must be published to the map first.
key_column string No The column that identifies a row. It must be unique and never empty, because a hit is only useful if it can be joined back to a metric.
text_columns array of strings Yes The columns whose text is indexed. At least one.
attribute_columns array of strings No Columns kept beside the text as filters, such as status, region or a date. They are not indexed as text.
model string No The embedding model to use. Leave it out for Sanda's default.
chunk_chars integer No How much text one indexed piece holds. The default is 1200 characters.
fts_config string, one of simple, english No Word matching: simple, or english, which stems words and drops common stop words.
after_sync string No A connection, by name or id. The service rebuilds each time it lands rows, which is usually the right trigger.
cron string No A five-field UTC cron on the quarter hour (minute 0, 15, 30 or 45), for a service rebuilt on a clock instead. With neither trigger the service is rebuilt when asked.
timezone string No The zone the cron was written for, kept for display. Evaluation is always UTC.
description string No What the service is for, in a sentence.
confirm boolean No Set to true to go ahead when the estimated cost is a large share of the day's AI limit.
replace boolean No Set to true to replace a service of the same name, rebuilding it from scratch.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

Sanda search must be switched on by a workspace owner in the console before this works. An agent holding the scope cannot switch it on, because it is a decision about where a business's data may be processed. A column whose name says it holds a secret is refused outright. Not offered to Sam.

update_search_service

Change a search serviceWritessearch:manageStandard · Enterprise

Redefines a search service or changes when it rebuilds. Changing the model, text columns, chunk size, word matching, key or source rebuilds the whole index at the cost of a first build. Changing only the attribute columns, description or cadence costs nothing.

Parameter Type Required Description
name string Yes The service to change, by name.
source string No A new source table on the map.
key_column string No A new key column.
text_columns array of strings No The new list of columns to index.
attribute_columns array of strings No The new list of filter columns.
model string No A different embedding model.
chunk_chars integer No A new chunk size.
fts_config string, one of simple, english No simple or english.
after_sync string No A connection, by name or id. Null clears it.
cron string No A five-field UTC cron on the quarter hour. Null clears the schedule.
timezone string No The zone the cron was written for, kept for display.
description string No A new description.
enabled boolean No false pauses rebuilding. Searches keep working on what is already indexed.
suspend_after_failures integer No Pause rebuilding after this many failures in a row.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

A well-behaved assistant tells the person before it rebuilds a large table. Not offered to Sam.

build_search_service

Index a search service nowWritessearch:manageStandard · Enterprise

Queues an index build now instead of waiting for the service's own trigger. Only rows whose text changed since the last build are sent to the model, so it is cheap on an unchanged table.

Parameter Type Required Description
name string Yes The service, by name.
full boolean No When true, discards the index and rebuilds every row. It costs what the first build cost.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

This only queues the build. Sanda's scheduler runs on a 15 minute grid, and indexing then runs in slices across as many ticks as it takes. Use run_search_build to spend the call indexing now. Not offered to Sam.

run_search_build

Index a search service now, inside this callWritessearch:manageStandard · Enterprise

Queues a build and then spends up to 55 seconds of the call indexing it, so a small index finishes inside the call. It reports what it read, embedded and cost.

Parameter Type Required Description
name string Yes The service, by name.
full boolean No When true, rebuilds every row and not only what changed.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

An index too large for one call keeps its place and says there is more to do: call again to carry it on, or leave it to the scheduler. This builds an index and does not query one. Use search_documents for that. Not offered to Sam.

drop_search_service

Remove a search serviceDestructivesearch:manageStandard · Enterprise

Removes a search service and deletes its index from the warehouse. Searches against it stop at once, and rebuilding it later costs a full first build. The definition and every build it ran stay on record.

Parameter Type Required Description
name string Yes The service to remove, by name.
warehouse string No Which warehouse, by name or id, when the workspace has more than one.

When the workspace asks for approval before an agent acts, this call is held for an owner or admin. See permissions and approvals. Not offered to Sam.

Knowledge

Search, browse and read the notes the workspace keeps about how the business works, write new ones for a person to check, and say whether a note helped.

search_notes

Search KnowledgeRead onlyquery:runStandard · Enterprise

Searches the workspace's Knowledge by meaning and by words, and returns the best section of each matching note with whether a person has verified it. An assistant calls it before answering a question about how the business does something, why a number moved or what was decided, and before it writes a note, to find one to change instead.

Parameter Type Required Description
query string Yes What to look for, as a question or a phrase. A note matches on any of its words, and the notes that match more of them rank higher.
folder string No Only notes under this folder, such as /procedures/. Leave it out to search all of Knowledge.
k integer No How many notes to return, up to the most the tool allows. Leave it out for a short list.
verified_only boolean No Only notes a person has verified. The default includes unverified notes, labelled as unverified.
warehouse string No Which warehouse holds the notes, by name or id. Leave it out to use the workspace's first warehouse.

Archived notes are never returned. If finding notes by meaning is switched off for the workspace, the answer says so and is found by words alone. Needs query:run, on an edition with Knowledge. See Knowledge.

list_notes

List notes in a folderRead onlyquery:runStandard · Enterprise

Lists the notes in a Knowledge folder and the folders inside it, like a file listing, with each note's title, whether it is verified and its version.

Parameter Type Required Description
folder string No The folder, such as /procedures/. Leave it out for the top level.
status string, one of live, verified, unverified, archived, all No Which notes to list: live (the default: verified and unverified), verified, unverified, archived or all.
warehouse string No Which warehouse holds the notes, by name or id. Leave it out to use the workspace's first warehouse.

Needs query:run, on an edition with Knowledge.

read_note

Read a noteRead onlyquery:runStandard · Enterprise

Reads one note whole: its markdown, whether a person verified it and who, where it came from, how often it helped or was reported wrong, and any change waiting for review. An assistant reads a note before changing it, because write_note needs the version this returns.

Parameter Type Required Description
path string Yes The note's path, such as /procedures/refunds.md, from search_notes or list_notes.
version integer No An earlier version of the note, by number. Leave it out for the current one.
warehouse string No Which warehouse holds the notes, by name or id. Leave it out to use the workspace's first warehouse.

A note with a change waiting says so, and the text returned is still the verified one until a person accepts the change. Needs query:run.

grep_notes

Find lines in notesRead onlyquery:runStandard · Enterprise

Finds the lines in notes that contain a phrase, with their line numbers. For an exact name, number or phrase; search_notes is better for a question.

Parameter Type Required Description
pattern string Yes The phrase to find, matched in any case.
regex boolean No Read the pattern as a POSIX regular expression instead of a phrase.
folder string No Only notes under this folder, such as /procedures/.
warehouse string No Which warehouse holds the notes, by name or id. Leave it out to use the workspace's first warehouse.

Needs query:run, on an edition with Knowledge.

write_note

Write a noteWritesknowledge:writeStandard · Enterprise

Writes a markdown note to Knowledge, or changes one. A new note from an assistant is unverified until a person checks it. A change to a verified note waits for a person to accept it, and agents keep reading the verified text until then.

Parameter Type Required Description
path string Yes Where the note lives, such as /procedures/refunds.md. It is written in lower case with hyphens, and .md is added if it is missing; the answer says the path it was saved at.
content string Yes The note, in markdown. Front matter with title, tags, source or review_by is read if it is there.
base_version integer No When changing a note that exists, the version read_note returned. A change made from an older version is refused with the current one, so nothing written since is lost.
title string No The note's title. Leave it out to use its first # heading.
tags array of strings No A few words to group it by.
source string No Where it came from: a link, a system, a document or a conversation.
review_by string No A day it should be checked again, as YYYY-MM-DD. Past it, the note is in the review queue.
comment string No One sentence on why it was written or changed, shown to the person who reviews it.
warehouse string No Which warehouse holds the notes, by name or id. Leave it out to use the workspace's first warehouse.

A note that looks like it holds a credential is refused, and so is an exact copy of another note. A note that reads like another is saved and marked as a possible copy for a person to look at. Needs knowledge:write, which any member may grant. See Knowledge and your agents.

rate_note

Say whether a note helpedWritesknowledge:writeStandard · Enterprise

Says whether a note helped, was wrong or is out of date. A note reported wrong or stale goes to the review queue for a person to check, and ranks lower in searches until they do.

Parameter Type Required Description
path string Yes The note's path, such as /procedures/refunds.md.
verdict string, one of helped, wrong, stale Yes helped, wrong, or stale for out of date.
comment string No One sentence on what was wrong or out of date, for the person who checks it.
warehouse string No Which warehouse holds the notes, by name or id. Leave it out to use the workspace's first warehouse.

Needs knowledge:write. An archived note cannot be rated.

Read and build reports

Find a report, read what it asks, ask it for today's numbers, and create, change, copy, restore or delete one.

list_reports

List reportsRead onlyquery:run

Lists the reports this credential can open: each one's name and id, how many blocks it has, whether it is a template or private, and whether it is emailed on a schedule.

Parameter Type Required Description
query string No Words from a report's name or description, to narrow the list.

A credential that can build reports sees every report, as an owner or admin does. Any other credential sees the workspace's reports, the private reports of the person behind it and the ones shared with them, never a colleague's private report. Every integration token can read reports, because every token can ask questions.

read_report

Read a reportRead onlyquery:run

Reads one report: what it is for, its report filters (the ones every block runs with) and every block, each written as the arguments add_block takes, with the block's id.

Parameter Type Required Description
report string Yes The report, by id or exact name, from list_reports.

It says what the report asks, not the answers: run_report gives those. Read a report before changing it with edit_report.

run_report

Run a reportRead onlyquery:run

Asks every block on a report again, now, and reads back what each says: the headline figure, the largest rows, the change against an earlier period where a block compares, and each text block as written.

Parameter Type Required Description
report string Yes The report, by id or exact name, from list_reports.
blocks array of strings No Only these blocks, by id or exact title from read_report. Leave it out for every block.

These are the answers an emailed report carries, composed from the workspace's own definitions with the report's filters applied, and nobody is emailed. Blocks are asked a few at a time, and none is started after 55 seconds; the answer names any that were not asked, so they can be asked for again with blocks. See report deliveries for what each block's lines mean.

report_history

A report’s saved versionsRead onlyquery:run

Lists the saved versions of one report, newest first, each with its id, when it was saved and how many blocks and filters it had.

Parameter Type Required Description
report string Yes The report, by id or exact name, from list_reports.

A report keeps its last 50 versions, and saves within two minutes of each other count as one. restore_report puts one back.

create_report

Create a reportWritesreports:write

Creates an empty report, with its description and its report filters, ready for add_block.

Parameter Type Required Description
name string Yes A short name, unique in the workspace, up to 160 characters.
description string No What the report should contain, in plain language, up to 1,000 characters. Later block prompts read it as the brief.
filters array of objects No The report's own filters, each a condition every block runs with, up to 20. A window such as last week is one in_range filter on the date dimension the blocks share.

A filter on a field the semantic model cannot reach is refused before anything is made. Set the filters here rather than afterwards, so every block is placed and checked with them. Building reports needs reports:write, which only an owner or admin can grant.

JSON
{
  "name": "June board pack",
  "description": "Revenue and margin for the board, by region.",
  "filters": [{ "field": "order date", "op": "in_range", "values": [], "relative": "last_month" }]
}

add_block

Put a block on a reportWritesreports:write

Puts one block on a report: written analysis, or a visual composed from the semantic model exactly as run_query composes a question. Nothing runs: the report runs each block when it opens.

Parameter Type Required Description
report string Yes The report, by id or exact name, from list_reports or create_report.
kind string, one of text, kpi, bar, column, line, area, donut, scatter, heatmap, table Yes text, or a visual: kpi, bar, column, line, area, donut, scatter, heatmap or table.
title string Yes A short title, as it appears on the block.
body string No Text blocks only: the analysis, in plain paragraphs. Every number in it should have come back from a tool call.
metrics array of strings No Metric names from search_fluid.
dimensions array of strings No Dimension names to break the numbers down by.
granularity string, one of day, week, month, quarter, year No How to group a time dimension: day, week, month, quarter or year.
columns array of objects No Raw columns, as {column, aggregate}, for a number no metric covers.
filters array of strings No Named filter names from search_fluid.
conditions array of objects No Narrowing for this block only, each as run_query takes it.
limit integer No Rows for a table, or bars for a chart, up to 200.
compare string, one of previous_period, previous_year No previous_period or previous_year, to draw the block against an earlier period. Needs one date window, on the block or as a report filter.
trend boolean No kpi only: draw a sparkline of the number over its date window.
layout string, one of stacked, grouped, percent No column and area only: stacked, grouped or percent.
sort string, one of largest, smallest, name No largest first (the default), smallest first, or by name.
ring boolean No kpi only: draw the number as a ring.
target object No A figure to measure against, as {value, label}. Only when the person gave one. The label is a word; the figure is printed beside it unless the label already says it.
order_by array of objects No How the rows are ordered, as {by, direction} pairs, first entry first. To order by a key nobody should read, add it to columns and hide it with sheet.
sheet object No table only: how its columns read, keyed by any name a column goes by. labels gives a column a short header, hidden keeps a column out of sight (a sort key), formats sets number, integer, percent, compact or text, and totals adds a totals row (sum, avg, min, max or count). A name the table does not show is left out, and the answer says so.

A kind the shape of the question cannot honestly be is placed as the nearest kind that can, with a sentence saying so. Each block is saved where the report has room, as a version restore_report can put back. Blocks placed at the same moment all land.

A report already open in somebody's browser holds its own copy: it shows the new block once the page is opened again, and that page's next save writes over it. Sam places blocks on a report open in front of a person as they watch; this tool is for a report wherever it is.

edit_report

Change a reportWritesreports:write

Changes a report that already exists: its filters, its blocks, its name or its description, in one call. Each change is kept as a version.

Parameter Type Required Description
report string Yes The report, by id or exact name, from list_reports.
name string No A new name, unique in the workspace.
description string No A new description. An empty string clears it.
filters array of objects No The report's whole new list of filters. [] clears them; leave it out to keep them.
update array of objects No Blocks to redefine in place, each with its id from read_report and only the fields that change. A new title or body alone keeps what the block shows.
remove array of strings No Ids of blocks to take off the report.

Every block is checked against the semantic model with the filters applied, and nothing changes if one of them could not run. A window such as the last 7 days belongs in filters, as one condition on the date dimension, rather than on each block.

duplicate_report

Copy a reportWritesreports:write

Copies a report: as a new report, as a template, or a new report from a template. The copy takes the blocks and filters, with fresh block ids.

Parameter Type Required Description
report string Yes The report or template to copy, by id or exact name.
name string No The copy's name, unique in the workspace. Defaults to the original's with copy or template after it.
description string No The copy's description. Defaults to the original's.
as_template boolean No true to save the copy as a template. Copy a template and leave this out to make a report from it.

The history, comments and deliveries stay with the original, and a private report makes a private copy.

restore_report

Put back an earlier versionWritesreports:write

Puts a report back the way one of its saved versions had it: its blocks, filters and colours. Its name stays.

Parameter Type Required Description
report string Yes The report, by id or exact name.
version string Yes The version's id, from report_history.

The state it replaces is kept as a version too, so a restore can itself be undone.

delete_report

Delete a reportDestructivereports:write

Deletes a report for good, with every saved version of it and every delivery that emails it.

Parameter Type Required Description
report string Yes The report, by id or exact name.

A credential an owner or admin granted may delete any report it can open; a member deletes only their own. When the workspace asks for approval before an agent acts, this call is held for an owner or admin. See permissions and approvals. To stop a report going out, pause its delivery instead.

Email reports

Schedule, change, pause, send and remove report deliveries.

list_deliveries

List report deliveriesRead onlyreports:deliver

Lists every report delivery: the report it sends, its cadence, who it goes to, whether it is paused, when it next goes and how its last run went, with each delivery's id. It also names the reports that have no delivery.

Parameter Type Required Description
report string No Only this report's deliveries, by name or id.

Reading deliveries needs the same scope as creating them, because the list is who receives what.

create_delivery

Schedule a report deliveryWritesreports:deliver

Emails a report on a schedule. At each firing Sanda asks every block on the report again and sends the answers to the recipients. Email only: Slack and webhook deliveries are set up on the Report schedules page, because their address is a secret.

Parameter Type Required Description
report string Yes The report to send, by name or id.
recipients array of strings Yes Email addresses, up to 25.
cron string Yes A five-field cron on the quarter hour (minute 0, 15, 30 or 45), for example 0 8 * * 1 for Mondays at 8.
timezone string No An IANA zone the cron is local to, for example Australia/Sydney. It stays on local time across daylight saving. Leave it out and the cron is UTC.
note string No A closing note for the email, up to 500 characters.

A workspace may limit which email domains a delivery can go to, and the answer says so when a recipient is outside them. To send a report once, create the delivery, send it with send_delivery, then pause it with pause_delivery.

When the workspace asks for approval before an agent acts, a call naming a recipient outside the domains its members use is held for an owner or admin, because a report emailed to someone cannot be recalled. See permissions and approvals. Sam always asks before an email, whatever its mode.

JSON
{
  "report": "Board pack",
  "recipients": ["cfo@example.com.au"],
  "cron": "0 8 * * 1",
  "timezone": "Australia/Sydney"
}

update_delivery

Change a report deliveryWritesreports:deliver

Changes who a delivery goes to, its closing note or when it goes. recipients is the whole new list, so to add someone pass the current recipients with them, and to remove someone leave them out.

Parameter Type Required Description
report string No The report the delivery sends, by name or id.
delivery string No The delivery's id, from list_deliveries, when the report has more than one.
recipients array of strings No The whole new list of email addresses.
cron string No A new five-field cron on the quarter hour. It stays on the delivery's own clock unless timezone names another.
timezone string No The IANA zone a new cron is local to. Leave it out to keep the delivery's own.
note string No A new closing note. An empty string removes it.

Held for approval on the same terms as create_delivery when a recipient is outside the domains the workspace's members use.

send_delivery

Send a report delivery nowWritesreports:deliver

Sends a delivery now, to its recipients, instead of waiting for its schedule. It goes out within a minute or two.

Parameter Type Required Description
report string No The report the delivery sends, by name or id.
delivery string No The delivery's id, when the report has more than one.

A paused delivery can still be sent by hand. Sam always asks first, whatever its mode.

pause_delivery

Pause or resume a report deliveryWritesreports:deliver

Pauses a delivery so its schedule stops sending it, or resumes a paused one. A resumed delivery next goes at its next firing from now.

Parameter Type Required Description
report string No The report the delivery sends, by name or id.
delivery string No The delivery's id, when the report has more than one.
resume boolean No true to resume. Leave it out or set it to false to pause.

delete_delivery

Remove a report deliveryDestructivereports:deliver

Removes a delivery. The report stays, and the record of every run it made stays on the timeline. Only the schedule and its recipients go.

Parameter Type Required Description
report string No The report the delivery sends, by name or id.
delivery string No The delivery's id, when the report has more than one.

pause_delivery is the way to stop one for a while. Sam always asks first, whatever its mode.

Streams

See the workspace's streams and stream graphs, what each run did and what a stream costs, and run, pause or resume one.

streams_overview

List the streamsRead onlyworkspace:readStandard · Enterprise

Lists every stream in the workspace, in both directions: what each one moves, when it runs, whether it is paused, and how its last run went. A pull lands another system's API in the warehouse, and a push sends numbers from the semantic model into another system.

Parameter Type Required Description
direction string, one of in, out No in for pulls only, out for pushes only. Leave it out for both.

Seeing streams needs only workspace:read, as the Streams pages are any member's. The streams tools are on the editions that include Streams, and Sam is not offered them: it has stream tools of its own for building and repairing connectors.

stream_history

A stream’s runsRead onlyworkspace:readStandard · Enterprise

Shows one stream's recent runs, newest first: when each ran, what started it, what it read, landed or sent, and why one failed or was skipped. Name a run to see the records it could not move and the last requests it made.

Parameter Type Required Description
stream string Yes The stream's name or id, from streams_overview.
run string No One run's id, from this tool's own list, for that run in detail.

A run's requests show the method, host, path, status and time of each, never a body or a credential.

estimate_stream_cost

Estimate what a stream costsRead onlyworkspace:readStandard · Enterprise

Estimates what a stream costs a month: its runs at the stream run price, at least a minute of warehouse compute for each run, and the rows it moves past the rows your edition includes. Name a stream to price it at its schedule and its recent pace, or give a schedule to price one before it exists.

Parameter Type Required Description
stream string No An existing stream's name or id, from streams_overview.
schedule string No A 5-field cron for a stream that does not exist yet, such as */15 * * * *. A schedule faster than your edition runs a stream is refused, with the reason.
source string No For a pull that does not exist yet, the published source it would read, such as bite. A source that limits how often a pull on it runs refuses a faster schedule here too, with the reason, as saving the pull would.
rows_per_run integer No How many rows one run moves. For an existing stream, its own recent pace when left out; for a new one, none.

The prices are your workspace's own, at today's rates, and the answer says them. A stream that runs only by hand has no month to add up, so the answer says what one run costs instead. See what streams cost.

run_stream

Run a stream nowWritesstreams:manageStandard · Enterprise

Starts one stream now instead of waiting for its schedule. A pull reads what is new since its last run and a push sends only what changed, unless full says to read or send everything again.

Parameter Type Required Description
stream string Yes The stream's name or id, from streams_overview.
full boolean No true to read everything again (a pull) or send everything again (a push).

A workspace's streams take turns for now, so a run may wait behind one already going (see runs at once). A pull on a source that limits how often a pull on it runs is skipped, with the reason, when its last run started more recently than that. stream_history shows how it went. Running a stream needs streams:manage, which only an owner or admin can grant.

pause_stream

Pause or resume a streamWritesstreams:manageStandard · Enterprise

Pauses a stream so nothing starts it (not its schedule, not a landing it waits on, not a stream graph), or resumes a paused or suspended one. Resuming resets its failure count.

Parameter Type Required Description
stream string Yes The stream's name or id, from streams_overview.
resume boolean No true to resume. Leave it out or set it to false to pause.

Pausing never changes what the stream is, so a stream that no longer saves can still be paused.

update_stream

Change a streamWritesstreams:manageStandard · Enterprise

Changes when a stream runs, its name, its description, or how many failures in a row pause it. A schedule faster than the edition or the source runs a stream is refused with the reason.

Parameter Type Required Description
stream string Yes The stream's name or id, from streams_overview.
rename string No A new name, unique in the workspace.
description string No A new description. An empty string clears it.
cron string No A five-field cron, for example */15 * * * *. An empty string takes the stream off its clock.
timezone string No An IANA zone the cron is local to, for example Australia/Sydney. Leave it out and the cron is UTC.
suspend_after_failures integer No Pause the stream after this many failures in a row. 0 never pauses.

What a stream moves, where it writes and the credential it uses are changed on the Streams page, because changing them can make the stream send every record again. Needs streams:manage, which only an owner or admin can grant. pause_stream pauses and resumes it.

preview_stream

Preview what a push would sendRead onlyquery:runStandard · Enterprise

Says what a push would send if it ran now, without sending anything or calling the system it writes to: how many rows it would read, how many are unchanged, held or refused, and the first few records it would send.

Parameter Type Required Description
stream string Yes The push's name or id, from streams_overview.

The records are your own data, so the preview rides query:run, as a question does. A field whose name says it holds a secret is not shown. A pull has no preview: stream_history says what its runs landed. See who can do what.

list_stream_graphs

List the stream graphsRead onlyworkspace:readStandard · Enterprise

Lists every stream graph: the pull whose landing starts it, the task that models what landed, the pushes that send the result, and how its last pass went.

Takes no parameters.

A pass whose modelling did not succeed sends nothing, and says why. See stream graphs.

run_stream_graph

Run a stream graph nowWritesstreams:manageStandard · Enterprise

Runs a stream graph now: its pull runs, and when that run lands rows the graph models them and starts its pushes.

Parameter Type Required Description
graph string Yes The graph's name or id, from list_stream_graphs.

A run that finds nothing new lands nothing, so nothing after it runs: nothing downstream has changed. Running a graph needs streams:manage.

create_stream_graph

Join a pull, a task and pushes in a stream graphWritesstreams:manageStandard · Enterprise

Joins a pull, the task that models what it lands and the pushes that send the result in a stream graph, which runs them in that order each time the pull lands rows.

Parameter Type Required Description
pull string Yes The pull whose landing starts the graph, by name or id, from streams_overview.
task string No The task that models what lands, by name or id, from list_schedules. It must be a task of the warehouse the pull lands in. Leave it out to send the rows as they landed.
pushes array of strings No The pushes the graph starts once the modelling succeeds, by name or id, from streams_overview. At most 20.
name string No A name, unique among the workspace's stream graphs. Leave it out and the graph is named for where its rows end up, such as Factory to Postgres.
description string No What the graph is for, shown at the top of its page.

The pull's schedule becomes the graph's one clock. Saving switches off the task's and the pushes' own schedules, and any sync or pull they ran after, and the answer says which, so a push never sends before the modelling. This is how a task runs after a pull lands: create_schedule's after_sync takes a connection, never a pull. Give a task, pushes, or both. Nothing runs until the pull next lands rows, or run_stream_graph. Sam is offered it under its streams capability, for owners and admins, and always asks first, whatever its mode. See stream graphs.

JSON
{
  "pull": "Factory",
  "task": "factory sales by product",
  "pushes": ["sales by product to Postgres"]
}

update_stream_graph

Change a stream graphWritesstreams:manageStandard · Enterprise

Changes a stream graph: its pull, its task or its pushes, its name or description, or pauses and resumes it. Only what is given changes.

Parameter Type Required Description
graph string Yes The graph's name or id, from list_stream_graphs.
pull string No Another pull to start the graph, by name or id.
task string No Another task to model with, by name or id. An empty string models nothing, so the pushes send the rows as they landed.
pushes array of strings No The whole new list of pushes, by name or id.
rename string No A new name, unique among the workspace's stream graphs.
description string No A new description. An empty string clears it.
enabled boolean No false pauses the graph and true resumes it.

A task or push the change adds has its own clock switched off, as create_stream_graph does. One it takes out is left with no schedule of its own, and the answer says so. A paused graph starts nothing when its pull lands, and its task and pushes, which have no clocks of their own, wait with it. Sam is offered it under its streams capability, for owners and admins, and always asks first, whatever its mode.

Approvals

Find out what happened to an action the workspace held for a person to approve.

action_status

Check an action waiting for approvalRead onlyany held scope

Reports what happened to an action the workspace held for approval: still waiting, declined, expired, or approved and what the tool answered when it ran. With no id it lists this credential's ten most recent actions.

Parameter Type Required Description
id string No The id the held call answered with. Leave it out to list recent actions.

A credential sees only its own actions. The tool is listed only for credentials that hold a scope a held tool needs (sql:write, warehouse:model, search:manage, reports:deliver or reports:write), because a credential that can only ask questions never has anything waiting. It is read-only, and it is never held itself.

A well-behaved assistant never tells a person a held action is done until this says it ran. See permissions and approvals.

Something unclear or out of date? Tell us, and we will fix the page.