← API reference
SCHEMA VIEW

Scripting

Tenant Lua scripts, custom actions and script validation.

Open workbench ↗Download SDL ↓AI context →

66 operations · complete schema 107 KB

Query

magicQuery

Executes a Magic Query string and returns the predefined query's JSON result. On a bad noun or parameter, returns a structured error whose 'extensions' carry 'code', 'actionable_message', and 'suggestions' for self-correction.

→
Query

getMagicQuerySchema

Returns the input JSON Schema and output introspection for a Magic Query noun, so consumers (especially LLMs) can learn its contract before calling magicQuery.

→
Query

listMagicQueries

Lists every available Magic Query noun with a short description and its options — the discovery entry point.

→
Query

getMagicQueryGraphQL

Resolves a Magic Query string to the real GraphQL operation and variables it runs, so consumers can graduate from the façade to raw GraphQL. Does not execute.

→
Query

listDataChangeEventTopics

List all valid data change event topics, grouped by resource. Requires authentication.

→
Query

generateDefaultDataQuery

Generate a default GraphQL data query for an event topic. Returns a query string with all scalar fields for the resource, or null if the topic has no matching query. The query uses $id as the variable for the resource ID.

→
Query

ping

Health check endpoint

→
Query

getScript

Fetch a script by ID. Requires script:read permission.

→
Query

getScriptByName

Fetch a script by name. Requires script:read permission.

→
Query

listScriptVersions

A script's history, newest first. Requires script:read permission.

→
Query

getScriptVersion

Fetch one version of a script. Requires script:read permission.

→
Query

listScripts

List scripts with pagination and filtering. Requires script:list permission.

→
Query

listLuaSamples

List the platform's Lua sample scripts. Metadata only — fetch source with getLuaSample. Every sample is type-checked and executed by tests. Requires script:read.

→
Query

getLuaSample

Fetch one Lua sample with its runnable source. Requires script:read.

→
Query

luaTypeDefinitions

Type definitions for a scripting role, rendered from the surface the validator checks against. Requires script:read.

→
Query

luaApiSurface

Structured ctx.* or bridge.* surface for editor completions and hover. Requires script:read.

→
Query

mcpTool

Read the authoring definition and assignments.

→
Query

mcpTools

List tenant tools for administration; not the end-user catalog.

→
Query

mcpToolVersions

Read immutable publication history.

→
Query

analyzeMCPToolSource

Infer and decorate a tool contract without saving or running it.

→
Query

getCustomWorkflowAction

Fetch a single custom action by id within the caller's tenant. Returns null when no such action exists. Requires customWorkflowAction:read permission.

→
Query

listCustomWorkflowActions

List the caller's tenant's custom actions, filtered and sorted. Requires customWorkflowAction:list permission.

→
Query

listAvailableActions

The tenant's unified action catalog: every active custom action plus every action declared by an active integration instance, ordered by label and keyset-paginated. Inactive custom actions are omitted. Requires customWorkflowAction:list permission.

→
Query

iacSchema

The infrastructure-only view of this schema, for declarative tooling. Contains only annotated resources and the types they reach.

→
Query

iacValidate

Validate an infrastructure artifact. Pure and side-effect free; safe to alias many times in one document.

→
Query

iacGuides

Every authoring guide, for a tool that syncs them to a folder. Intended for `schema pull` to call once and write to disk, not for an agent to call while authoring — a file can be grepped and re-read in part, where a response arrives whole.

→
Query

helpChapters

List human-facing manual chapters from the running deployment.

→
Query

helpChapter

Read a chapter of the current published manual edition.

→
Query

searchHelp

Search human-facing manuals using shared semantic and text retrieval.

→
Query

schemaAuthoringCatalog

Compiler-owned vocabulary for the standalone XML JSON Schema dialect, including native form annotations.

→
Query

compileSchemaXML

Compile standalone XML schema syntax into JSON Schema without persisting it; host restrictions apply when embedded.

→
Query

renderSchemaXML

Render JSON Schema as native XML without dropping unsupported keywords or changing a saved document.

→
Query

iacSchemaDocument

Fetch the JSON Schema document a SCHEMA-kind validator references, for declarative tooling.

→
Query

getTemplate

Fetch a template by ID. Requires template:read permission.

→
Query

getTemplateByHandle

Fetch a template by handle. Requires template:read permission.

→
Query

listTemplates

List templates with pagination and filtering. Requires template:list permission.

→
Query

getTemplateVersion

Fetch one template version by ID. Requires template:read permission.

→
Query

listTemplateVersions

List versions of a template with pagination. Requires template:read permission.

→
Mutation

upsertScript

Create or update a script. Requires script:write permission.

→
Mutation

createScript

Create a new script. Requires script:write permission.

→
Mutation

updateScript

Update a script. Only provided fields are changed. Requires script:write permission.

→
Mutation

restoreScriptVersion

Put an old version's source back on the script. Appends a new version rather than rewinding history. The name and role are not restored, only the source. Requires script:write permission.

→
Mutation

deleteScript

Delete a script. Requires script:delete permission.

→
Mutation

createMCPTool

Create a tool definition. Requires mcpTool:write.

→
Mutation

upsertMCPTool

Upsert a tool definition. Requires mcpTool:write.

→
Mutation

updateMCPTool

Update a tool definition. Requires mcpTool:write.

→
Mutation

publishMCPTool

Analyze and publish the current draft atomically.

→
Mutation

deleteMCPTool

Delete a tool and its versions and assignments.

→
Mutation

testMCPTool

Run the current draft as the authenticated developer; also requires mcpTool:read.

→
Mutation

validateLua

Type-check Lua source against the ambient typedef for the chosen role without persisting anything. Safe to call from editors on every keystroke.

→
Mutation

upsertCustomWorkflowAction

Create a custom action, or overwrite an existing one when input.id is supplied. Overwrite semantics: omitted optional fields are written as null, unlike updateCustomWorkflowAction. Requires customWorkflowAction:write permission.

→
Mutation

createCustomWorkflowAction

Create a new custom action. Requires customWorkflowAction:write permission.

→
Mutation

updateCustomWorkflowAction

Update a custom action. Only provided fields are changed. Requires customWorkflowAction:write permission.

→
Mutation

deleteCustomWorkflowAction

Permanently delete a custom action from the caller's tenant. Reports notFound when no such action exists. Requires customWorkflowAction:delete permission.

→
Mutation

upsertTemplate

Create or update a template. Requires template:write permission.

→
Mutation

createTemplate

Create a new template. Requires template:write permission.

→
Mutation

updateTemplate

Update a template. Only provided fields are changed. Requires template:write permission.

→
Mutation

deleteTemplate

Delete a template and all its versions. Requires template:delete permission.

→
Mutation

validateTemplate

Validate template syntax without saving. Requires template:read permission.

→
Mutation

publishTemplateVersion

Publish current template content as a new version. Requires template:write permission.

→
Mutation

deleteTemplateVersion

Delete one version from a template's history. Fails when the version is the one the template is currently published at. Requires template:write permission.

→
Mutation

restoreTemplateVersion

Restore template content from a previous version. Requires template:write permission.

→
Mutation

renderTemplate

Render a template with context data. Requires template:execute permission.

→
Mutation

validateLuaScript

Validate a Lua script for syntax errors. Requires script:execute permission.

→
Mutation

executeLuaScript

Execute a Lua script in the playground sandbox. Requires script:execute permission.

→
Subscription

dataChangeEvents

Subscribe to real-time data change events. Requires read permission on each requested resource.

→