For the complete documentation index, see llms.txt. This page is also available as Markdown.

Platform Functions

Register, invoke, test, list, and delete workspace SQL, Python, AI, and UDTF functions for governed agent data access and computation during conversations.

Platform functions are workspace-registered computation tools for agent data access. You register a supported SQL query, Python function, AI composition, or table-valued function in the workspace function registry. Supported agent runtimes can expose a successfully loaded function during conversations; the function runs on the platform's compute layer without a separate application container.

Each function is identified by name within a workspace. Deploying the same name updates that function in place; the public REST API does not expose function versions, aliases, promote, or rollback operations.

Conceptual overview. For background on named functions and how functions relate to Actions and Skills, see the Platform Functions conceptual docs.

Function Types

Type (function_type)

Description

sql

Parameterized SQL template returning rows or a scalar across live and analytical data

ai

SQL wrapping an AI query (classify, summarize, extract, mask)

python

Warehouse-sandboxed scalar Python user-defined function

udtf

Warehouse-sandboxed table-valued user-defined function

The function_type field is a closed set of these four values. A separate returns_kind field describes whether a function returns a table (rows as a list of objects) or a scalar (a single value); this is independent of the function type.

Tools in the Agent's Context Graph

A platform function can surface as a tool after it is registered for the workspace and loaded by a supported runtime. Availability for a session also depends on the selected runtime and any applicable context-graph bindings. When exposed, the agent sees the function's tool name, description, input schema, and result.

Named Functions

Named functions are registered computations with fixed input schemas. When loaded as agent tools, they use the fn_ prefix (for example, fn_caller_history or fn_entity_confidence).

Depending on deployment and workspace registration, common examples can include entity confidence assessment, caller history, and patient summaries. Do not assume an example is available in a session without checking registration and runtime loading; see Named Functions for the conceptual model.

Long-Tail and Ad Hoc Queries

For questions no named function anticipates, use workspace data queries (wsq_<name>): parameterized SQL templates registered per workspace and surfaced to the agent at session start.

Platform functions are read-only by construction (SELECT/WITH only; INSERT/UPDATE/DELETE are rejected). World model writes go through dedicated write tools, not through this surface.

Loading and State Gating

Functions and workspace data queries are loaded at session start from the workspace's function store. In the standard HSM runtime, registered functions and queries with descriptions are exposed per context-graph state through tool_call_specs. Native and realtime runtimes can additionally attach a runtime-defined shared platform or system tool set globally, so absence from a state's spec is not a universal security guarantee. Platform functions remain read-only, and runtime authorization and write-scope checks remain the execution boundary.

Built-in Tool Catalog

Returns the live catalog of built-in tools the platform exposes at runtime, so integrators and tooling can discover what is available rather than relying on a hardcoded list. The catalog stays current as built-in tools are added or retired. Read-only; requires a workspace API key.

List built-in tool catalog

get

List the platform's built-in world + surface tools (workspace-independent).

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Responses
200

Successful Response

application/json
get/v1/{workspace_id}/tools/catalog
GET /v1/{workspace_id}/tools/catalog HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "tools": [
    {
      "tool_name": "text",
      "tool_type": "text",
      "description": "",
      "input_schema": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "states": [
        "text"
      ],
      "tier": "world",
      "is_write": false,
      "additional_instructions": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      }
    }
  ]
}

This catalog covers the platform's built-in tools. Workspace-specific tools - deployed platform functions (fn_*, listed below) and workspace data queries (wsq_*) - are discovered through their own list endpoints.

Deploy or Update a Function

Validates and upserts a function. The URL function_name is authoritative and must match the request body name.

Deploy (validate + upsert) a platform function

put

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
function_namestringRequired
Body

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.

namestring · min: 1 · max: 128RequiredPattern: ^[a-z][a-z0-9_]*$
descriptionstring · min: 1 · max: 2048Required
when_to_usestring · max: 2048OptionalDefault: ""
function_typestring · enumOptionalDefault: sqlPossible values:
returnsstring · enumOptionalDefault: tablePossible values:
returns_typestring · enumOptionalDefault: stringPossible values:
bodystring · min: 1 · max: 8192Required
timeout_msinteger · min: 100 · max: 60000OptionalDefault: 30000
Responses
200

Successful Response

application/json

Single row from platform.functions.

namestringRequired
function_typestringRequired
returns_kindstringRequired
descriptionstringOptionalDefault: ""
when_to_usestringOptionalDefault: ""
sql_templatestringRequired
timeout_msintegerOptionalDefault: 30000
last_test_atstring · nullableOptional
last_test_statusstring · nullableOptional
last_test_errorstring · nullableOptional
last_test_duration_msinteger · nullableOptional
deployed_atstring · nullableOptional
deployed_bystring · nullableOptional
put/v1/{workspace_id}/functions/{function_name}
PUT /v1/{workspace_id}/functions/{function_name} HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 537

{
  "name": "text",
  "description": "text",
  "when_to_use": "",
  "function_type": "sql",
  "returns": "table",
  "returns_type": "string",
  "parameters": [
    {
      "name": "text",
      "type": "string",
      "description": "text",
      "default": "text",
      "authorization_binding": {
        "source": "text",
        "resource_type": "text",
        "access": "read",
        "encoding": "csv"
      },
      "authorization_binding_test_value": "text"
    }
  ],
  "returns_columns": [
    {
      "name": "text",
      "type": "string",
      "description": ""
    }
  ],
  "body": "text",
  "timeout_ms": 30000,
  "examples": [
    {
      "input": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "output": null,
      "description": ""
    }
  ]
}
{
  "name": "text",
  "function_type": "text",
  "returns_kind": "text",
  "description": "",
  "when_to_use": "",
  "parameters": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "sql_template": "text",
  "input_schema": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "examples": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "timeout_ms": 30000,
  "last_test_at": "text",
  "last_test_status": "text",
  "last_test_error": "text",
  "last_test_duration_ms": 1,
  "deployed_at": "text",
  "deployed_by": "text"
}

Example

Permissions: Admin or Owner role.

List Functions

Returns the registered functions in the workspace.

List every platform function registered in the workspace

get

List every platform function registered in the workspace.

Permissions: Workspace.view (read role and above).

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Responses
200

Successful Response

application/json
countintegerRequired
get/v1/{workspace_id}/functions
GET /v1/{workspace_id}/functions HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "name": "text",
      "function_type": "text",
      "returns_kind": "text",
      "description": "",
      "when_to_use": "",
      "parameters": [
        {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      ],
      "sql_template": "text",
      "input_schema": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "examples": [
        {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      ],
      "timeout_ms": 30000,
      "last_test_at": "text",
      "last_test_status": "text",
      "last_test_error": "text",
      "last_test_duration_ms": 1,
      "deployed_at": "text",
      "deployed_by": "text"
    }
  ],
  "count": 1
}

Get a Function

Returns a single registered function.

Get a registered platform function by name

get

Resolve a function by name.

Permissions: Workspace.view (read role and above).

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
function_namestringRequired
Responses
200

Successful Response

application/json

Single row from platform.functions.

namestringRequired
function_typestringRequired
returns_kindstringRequired
descriptionstringOptionalDefault: ""
when_to_usestringOptionalDefault: ""
sql_templatestringRequired
timeout_msintegerOptionalDefault: 30000
last_test_atstring · nullableOptional
last_test_statusstring · nullableOptional
last_test_errorstring · nullableOptional
last_test_duration_msinteger · nullableOptional
deployed_atstring · nullableOptional
deployed_bystring · nullableOptional
get/v1/{workspace_id}/functions/{function_name}
GET /v1/{workspace_id}/functions/{function_name} HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "name": "text",
  "function_type": "text",
  "returns_kind": "text",
  "description": "",
  "when_to_use": "",
  "parameters": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "sql_template": "text",
  "input_schema": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "examples": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "timeout_ms": 30000,
  "last_test_at": "text",
  "last_test_status": "text",
  "last_test_error": "text",
  "last_test_duration_ms": 1,
  "deployed_at": "text",
  "deployed_by": "text"
}

Invoke a Function

Executes a registered function with caller-supplied arguments.

Execute a registered platform function

post

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
function_namestringRequired
Body

Invoke a registered function with caller-supplied args.

Responses
200

Successful Response

application/json
resultanyOptional
duration_msnumberOptionalDefault: 0
row_countintegerOptionalDefault: 0
post/v1/{workspace_id}/functions/{function_name}/invoke
POST /v1/{workspace_id}/functions/{function_name}/invoke HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "input": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
{
  "result": null,
  "duration_ms": 0,
  "row_count": 0
}

Permissions: Workspace view permission.

Arguments that do not fit the declared parameters[] return 422 with the reason, such as Missing required argument: '<name>'., an unknown argument, or a value that cannot be converted to its declared type. Fix the call; resending it unchanged fails the same way. 503 means execution failed and can be retried. The MCP invoke_platform_function tool returns both as an error result.

Test a Function

Runs the same execution path as invoke and stores last_test_* telemetry on the function. Logical execution failures return 200 with status: "fail" and an error value so dashboards can render the failure detail.

Test invoke + persist last_test_* telemetry on the row

post

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.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
function_namestringRequired
Body

Invoke a registered function with caller-supplied args.

Responses
200

Successful Response

application/json

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 an HTTPException (503 or 422) 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.

resultanyOptional
duration_msnumberOptionalDefault: 0
row_countintegerOptionalDefault: 0
statusstringOptionalDefault: pass
errorstring · max: 2000 · nullableOptional
test_duration_msinteger · nullableOptional
post/v1/{workspace_id}/functions/{function_name}/test
POST /v1/{workspace_id}/functions/{function_name}/test HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "input": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
{
  "result": null,
  "duration_ms": 0,
  "row_count": 0,
  "status": "pass",
  "error": "text",
  "test_duration_ms": 1
}

Permissions: Admin or Owner role.

Delete a Function

Deletes a registered function. Deleting a Python or UDTF function also removes its warehouse artifact; if the artifact drop fails, the registry entry is preserved so the delete can be retried safely.

Remove a registered platform function

delete

Remove a registered function row.

Permissions: admin, owner.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
function_namestringRequired
Responses
204

Successful Response

No content

delete/v1/{workspace_id}/functions/{function_name}
DELETE /v1/{workspace_id}/functions/{function_name} HTTP/1.1
Host: platform.api-us.concurrence.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Permissions: Admin or Owner role.

CLI

Platform functions can be managed through Agent Forge:

Comparison with Data-MCP

Platform functions are the primitive for agent data access; Data-MCP is a separate SQL query surface for external MCP clients. The key differences:

Data-MCP
Platform Functions

Integration

External MCP client required

Built into the agent reasoning pipeline

Access

SQL queries only

SQL + Python + AI operations

Tool resolution

Separate from context graph

State-gated through tool_call_specs in the standard HSM runtime; native/realtime runtimes can also attach shared tools globally

Write capability

Read-only

Read-only (world model writes go through dedicated write tools, not platform functions)

Loading

Manual

Loaded at session start from the workspace function store

Last updated

Was this helpful?