Platform Functions
SQL, Python, AI, and UDTF functions that give agents direct access to world model data and analytics during conversations, with endpoints to register, invoke, test, list, and delete them.
Function Types
Tools in the Agent's Context Graph
Named Functions
Long-Tail and Ad Hoc Queries
Loading and State Gating
Endpoints
Deploy or Update a Function
Validate + upsert a platform function row.
Atomic: validation + (python/udtf only) UC UDF materialization +
upsert into platform.functions happen as one logical operation.
Repeat deploys against the same (workspace, name) replace the
row in place and clear stale last_test_* telemetry.
The function name comes from the URL path; the request body's
name field must match or a 400 is raised. The URL is the
authoritative source.
Permissions: admin, owner.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
The authored shape of a platform function.
Identical wire format whether it's authored as a YAML file in the
repo or POSTed to /v1/{ws}/functions/deploy. The deploy
pipeline validates this, derives the JSON Schema for the LLM tool
spec, and INSERTs a row into platform.functions with the next
monotonic version per (workspace_id, name). For
python / udtf rows, deploy ALSO issues
CREATE OR REPLACE FUNCTION against the warehouse to materialize
the UC UDF.
^[a-z][a-z0-9_]*$""sqlPossible values: tablePossible values: stringPossible values: 30000Successful Response
Single row from platform.functions.
""""30000URL function_name does not match body name
Validation failure (read-only / bind / parity)
Rate limited
Example
List Functions
List every platform function registered in the workspace.
Permissions: Workspace.view (read role and above).
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
Rate limited
Get a Function
Resolve a function by name.
Permissions: Workspace.view (read role and above).
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
Single row from platform.functions.
""""30000Function not found
Validation Error
Rate limited
Invoke a Function
Execute a registered function and return its rows.
Bound parameters are validated against the stored schema; ws_id
is auto-injected from the request context. Returns the executor's
shaped response (rows for returns=table, scalar value for
returns=scalar).
Permissions: Workspace.view (read role and above). Read-only
keys are intentionally allowed — invocation runs a stored,
pre-validated SELECT against catalogs the workspace SP already has
SELECT on; the gate on what can run is the deploy-time validator
(read-only invariant), not the per-call permission.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Invoke a registered function with caller-supplied args.
Successful Response
00Function not found
Bind validation failure
Rate limited
Test a Function
Test invoke — same as invoke + persists last_test_* on the row.
Returns 200 with status="fail" + populated error on
execution failure (instead of a 5xx) so the DC has a single
happy-path rendering.
Permissions: admin, owner.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Invoke a registered function with caller-supplied args.
Successful Response
Response shape for POST /v1/{ws}/functions/{name}/test.
Structural superset of :class:InvokeResponse. Adds status and
error so the DC can render the executor's failure detail inline
rather than a generic "Invocation failed." The underlying invoke
uses the same path; status / error are filled in by
service.test after catching any HTTPException (503) from the
executor, so the route never bubbles a 5xx for a logical SQL
failure — it's still a 200 with status=fail so the caller can
show the message.
Invariant (enforced by :func:_check_error_when_fail):
status == "fail" → error is not None and len(error) > 0.
00passFunction not found
Validation Error
Rate limited
Delete a Function
Remove a registered function row.
Permissions: admin, owner.
API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.
Successful Response
No content
Function not found
Validation Error
Rate limited
No content
Registered Function Object
CLI
Comparison with Data-MCP
Last updated
Was this helpful?

