@xano/developer-mcp 2.3.0-beta.6 → 2.3.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,11 +56,27 @@ After \`workspace pull\`, files are organized using snake_case naming:
56
56
  │ │ └── on_connect.xs # MCP server triggers
57
57
  │ └── tool/
58
58
  │ └── my_tool.xs # AI tools
59
+ ├── prompt/
60
+ │ └── code_review.xs # MCP prompts
61
+ ├── resource/
62
+ │ └── order_docs.xs # MCP resources
59
63
  ├── realtime/
64
+ │ ├── server/
65
+ │ │ └── chat/ # Realtime V2 server folder
66
+ │ │ ├── chat.xs # Realtime V2 server
67
+ │ │ ├── trigger/
68
+ │ │ │ └── on_connect.xs # Server connect/disconnect triggers
69
+ │ │ └── channel/
70
+ │ │ └── rooms_room_id/
71
+ │ │ ├── rooms_room_id.xs # Channel "rooms/{room_id}"
72
+ │ │ ├── message/
73
+ │ │ │ └── send.xs # Channel messages
74
+ │ │ └── trigger/
75
+ │ │ └── on_join.xs # Channel join/leave/deliver triggers
60
76
  │ ├── channel/
61
- │ │ └── my_channel.xs # Realtime channels
77
+ │ │ └── my_channel.xs # Legacy V1 realtime channels
62
78
  │ └── trigger/
63
- │ └── on_connect.xs # Realtime triggers
79
+ │ └── on_connect.xs # Legacy V1 realtime triggers
64
80
  └── knowledge/ # Knowledge & skills (markdown, synced automatically)
65
81
  ├── agents.md # Workspace AGENTS.md
66
82
  ├── docs/
@@ -17,7 +17,7 @@ export const apiDoc = {
17
17
  {
18
18
  method: "GET",
19
19
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/api",
20
- tool_name: "listApis",
20
+ tool_name: "listAPIs",
21
21
  description: "List all API endpoints in an API group.",
22
22
  parameters: [
23
23
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -33,7 +33,7 @@ export const apiDoc = {
33
33
  {
34
34
  method: "GET",
35
35
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/api/{api_id}",
36
- tool_name: "getApi",
36
+ tool_name: "getAPI",
37
37
  description: "Get details of a specific API endpoint.",
38
38
  parameters: [
39
39
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -46,7 +46,7 @@ export const apiDoc = {
46
46
  {
47
47
  method: "POST",
48
48
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/api",
49
- tool_name: "createApi",
49
+ tool_name: "createAPI",
50
50
  description: "Create a new API endpoint with XanoScript logic.",
51
51
  parameters: [
52
52
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -76,7 +76,7 @@ export const apiDoc = {
76
76
  {
77
77
  method: "PUT",
78
78
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/api/{api_id}",
79
- tool_name: "updateApi",
79
+ tool_name: "updateAPI",
80
80
  description: "Update an existing API endpoint.",
81
81
  parameters: [
82
82
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -98,7 +98,7 @@ export const apiDoc = {
98
98
  {
99
99
  method: "DELETE",
100
100
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/api/{api_id}",
101
- tool_name: "deleteApi",
101
+ tool_name: "deleteAPI",
102
102
  description: "Delete an API endpoint.",
103
103
  parameters: [
104
104
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -109,7 +109,7 @@ export const apiDoc = {
109
109
  {
110
110
  method: "PUT",
111
111
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/api/{api_id}/security",
112
- tool_name: "updateApiSecurity",
112
+ tool_name: "updateAPISecurity",
113
113
  description: "Update security settings for a specific endpoint (overrides group settings).",
114
114
  parameters: [
115
115
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -16,7 +16,7 @@ export const apigroupDoc = {
16
16
  {
17
17
  method: "GET",
18
18
  path: "/workspace/{workspace_id}/apigroup",
19
- tool_name: "listApiGroups",
19
+ tool_name: "listAPIGroups",
20
20
  description: "List all API groups in a workspace with filtering and sorting.",
21
21
  parameters: [
22
22
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -83,7 +83,7 @@ export const apigroupDoc = {
83
83
  {
84
84
  method: "GET",
85
85
  path: "/workspace/{workspace_id}/apigroup/{apigroup_id}/openapi",
86
- tool_name: "getApiGroupOpenAPI",
86
+ tool_name: "getApiGroupSwagger",
87
87
  description: "Get OpenAPI v3 specification for this API group's endpoints.",
88
88
  parameters: [
89
89
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -41,7 +41,7 @@ Returns: id, name, email, and extras (including role and workspace access).`,
41
41
  {
42
42
  method: "GET",
43
43
  path: "/auth/me",
44
- tool_name: "getAuthMe",
44
+ tool_name: "getLoggedInUser",
45
45
  description: "Get the authenticated user's information including ID, name, email, and role.",
46
46
  response: {
47
47
  type: "object",
@@ -9,6 +9,8 @@ export const historyDoc = {
9
9
  - **Task History**: Scheduled task execution logs
10
10
  - **Middleware History**: Middleware execution logs
11
11
  - **Tool History**: Agent tool execution logs
12
+ - **Prompt History**: MCP prompt request logs
13
+ - **Resource History**: MCP resource request logs
12
14
  - **Trigger History**: Event trigger execution logs
13
15
 
14
16
  ## Common Use Cases
@@ -27,7 +29,7 @@ export const historyDoc = {
27
29
  {
28
30
  method: "GET",
29
31
  path: "/workspace/{workspace_id}/request_history",
30
- tool_name: "getRequestHistory",
32
+ tool_name: "getApiRequestHistory",
31
33
  description: "Get API request history with pagination.",
32
34
  parameters: [
33
35
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -41,7 +43,7 @@ export const historyDoc = {
41
43
  {
42
44
  method: "POST",
43
45
  path: "/workspace/{workspace_id}/request_history/search",
44
- tool_name: "searchRequestHistory",
46
+ tool_name: "searchApiRequestHistory",
45
47
  description: "Search request history with advanced filters.",
46
48
  parameters: [
47
49
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
@@ -62,7 +64,7 @@ export const historyDoc = {
62
64
  {
63
65
  method: "GET",
64
66
  path: "/workspace/{workspace_id}/function_history",
65
- tool_name: "getFunctionHistory",
67
+ tool_name: "getFunctionRequestHistory",
66
68
  description: "Get function execution history.",
67
69
  parameters: [
68
70
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -74,7 +76,7 @@ export const historyDoc = {
74
76
  {
75
77
  method: "GET",
76
78
  path: "/workspace/{workspace_id}/task_history",
77
- tool_name: "getTaskHistory",
79
+ tool_name: "getTaskRequestHistory",
78
80
  description: "Get scheduled task execution history.",
79
81
  parameters: [
80
82
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -86,7 +88,7 @@ export const historyDoc = {
86
88
  {
87
89
  method: "GET",
88
90
  path: "/workspace/{workspace_id}/middleware_history",
89
- tool_name: "getMiddlewareHistory",
91
+ tool_name: "getMiddlewareRequestHistory",
90
92
  description: "Get middleware execution history.",
91
93
  parameters: [
92
94
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -98,7 +100,7 @@ export const historyDoc = {
98
100
  {
99
101
  method: "GET",
100
102
  path: "/workspace/{workspace_id}/tool_history",
101
- tool_name: "getToolHistory",
103
+ tool_name: "getToolRequestHistory",
102
104
  description: "Get agent tool execution history.",
103
105
  parameters: [
104
106
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -107,10 +109,38 @@ export const historyDoc = {
107
109
  { name: "per_page", type: "integer", default: 50, description: "Items per page" }
108
110
  ]
109
111
  },
112
+ {
113
+ method: "GET",
114
+ path: "/workspace/{workspace_id}/prompt_history",
115
+ tool_name: "getPromptRequestHistory",
116
+ description: "Get MCP prompt request history, newest first.",
117
+ parameters: [
118
+ { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
119
+ { name: "prompt_id", type: "integer", description: "Filter by MCP prompt ID" },
120
+ { name: "branch", type: "string", description: "Filter by branch name" },
121
+ { name: "page", type: "integer", default: 1, description: "Page number" },
122
+ { name: "per_page", type: "integer", default: 50, description: "Items per page (max 500)" },
123
+ { name: "include_output", type: "boolean", default: false, description: "Include each request's output" }
124
+ ]
125
+ },
126
+ {
127
+ method: "GET",
128
+ path: "/workspace/{workspace_id}/resource_history",
129
+ tool_name: "getResourceRequestHistory",
130
+ description: "Get MCP resource request history, newest first.",
131
+ parameters: [
132
+ { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
133
+ { name: "resource_id", type: "integer", description: "Filter by MCP resource ID" },
134
+ { name: "branch", type: "string", description: "Filter by branch name" },
135
+ { name: "page", type: "integer", default: 1, description: "Page number" },
136
+ { name: "per_page", type: "integer", default: 50, description: "Items per page (max 500)" },
137
+ { name: "include_output", type: "boolean", default: false, description: "Include each request's output" }
138
+ ]
139
+ },
110
140
  {
111
141
  method: "GET",
112
142
  path: "/workspace/{workspace_id}/trigger_history",
113
- tool_name: "getTriggerHistory",
143
+ tool_name: "getTriggerRequestHistory",
114
144
  description: "Get trigger execution history.",
115
145
  parameters: [
116
146
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -147,5 +177,5 @@ export const historyDoc = {
147
177
  }
148
178
  }
149
179
  },
150
- related_topics: ["api", "function", "task"]
180
+ related_topics: ["api", "function", "task", "prompt", "resource"]
151
181
  };
@@ -28,7 +28,7 @@ export const mcpServerDoc = {
28
28
  {
29
29
  method: "GET",
30
30
  path: "/workspace/{workspace_id}/mcp_server",
31
- tool_name: "listMcpServers",
31
+ tool_name: "listMCPServers",
32
32
  description: "List all MCP servers in a workspace.",
33
33
  parameters: [
34
34
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -41,7 +41,7 @@ export const mcpServerDoc = {
41
41
  {
42
42
  method: "GET",
43
43
  path: "/workspace/{workspace_id}/mcp_server/{mcp_server_id}",
44
- tool_name: "getMcpServer",
44
+ tool_name: "getMCPServer",
45
45
  description: "Get details of a specific MCP server.",
46
46
  parameters: [
47
47
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -52,7 +52,7 @@ export const mcpServerDoc = {
52
52
  {
53
53
  method: "POST",
54
54
  path: "/workspace/{workspace_id}/mcp_server",
55
- tool_name: "createMcpServer",
55
+ tool_name: "createMCPServer",
56
56
  description: "Create a new MCP server to expose tools.",
57
57
  parameters: [
58
58
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
@@ -84,7 +84,7 @@ export const mcpServerDoc = {
84
84
  {
85
85
  method: "PUT",
86
86
  path: "/workspace/{workspace_id}/mcp_server/{mcp_server_id}",
87
- tool_name: "updateMcpServer",
87
+ tool_name: "updateMCPServer",
88
88
  description: "Update an existing MCP server.",
89
89
  parameters: [
90
90
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -102,7 +102,7 @@ export const mcpServerDoc = {
102
102
  {
103
103
  method: "DELETE",
104
104
  path: "/workspace/{workspace_id}/mcp_server/{mcp_server_id}",
105
- tool_name: "deleteMcpServer",
105
+ tool_name: "deleteMCPServer",
106
106
  description: "Delete an MCP server.",
107
107
  parameters: [
108
108
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -112,7 +112,7 @@ export const mcpServerDoc = {
112
112
  {
113
113
  method: "GET",
114
114
  path: "/mcp_server/documentation",
115
- tool_name: "getMcpDocumentation",
115
+ tool_name: "documentation",
116
116
  description: "Get MCP documentation for setup and syntax reference.",
117
117
  parameters: [
118
118
  { name: "type", type: "string", enum: ["start", "api", "function", "task", "mcp", "agent", "tool", "fs-syntax", "table", "database"], description: "Documentation type to retrieve" }
@@ -26,7 +26,7 @@ export const middlewareDoc = {
26
26
  {
27
27
  method: "GET",
28
28
  path: "/workspace/{workspace_id}/middleware",
29
- tool_name: "listMiddlewares",
29
+ tool_name: "listmiddlewares",
30
30
  description: "List all middleware in a workspace.",
31
31
  parameters: [
32
32
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -26,7 +26,7 @@ export const tableDoc = {
26
26
  {
27
27
  method: "GET",
28
28
  path: "/workspace/{workspace_id}/table",
29
- tool_name: "listTables",
29
+ tool_name: "getTables",
30
30
  description: "List all database tables in a workspace.",
31
31
  parameters: [
32
32
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
@@ -53,7 +53,7 @@ export const tableDoc = {
53
53
  {
54
54
  method: "POST",
55
55
  path: "/workspace/{workspace_id}/table",
56
- tool_name: "createTable",
56
+ tool_name: "addTable",
57
57
  description: "Create a new database table with optional schema.",
58
58
  parameters: [
59
59
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
@@ -126,7 +126,7 @@ export const workspaceDoc = {
126
126
  {
127
127
  method: "GET",
128
128
  path: "/workspace/{workspace_id}/openapi",
129
- tool_name: "getWorkspaceOpenAPI",
129
+ tool_name: "getWorkspaceOpenApi",
130
130
  description: "Get OpenAPI v3 specification for all APIs in the workspace.",
131
131
  parameters: [
132
132
  { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
@@ -20,12 +20,17 @@ XanoScript is the declarative scripting language for [Xano](https://xano.com), a
20
20
  | `agent_trigger` | `ai/agent/trigger/{name}.xs` | Agent event handlers |
21
21
  | `tool` | `ai/tool/{name}.xs` | Tools for AI agents |
22
22
  | `mcp_server` | `ai/mcp_server/{name}.xs` | MCP server definitions |
23
- | `prompt` | `ai/prompt/{name}.xs` | MCP prompts |
24
- | `resource` | `ai/resource/{name}.xs` | MCP resources |
23
+ | `prompt` | `prompt/{name}.xs` | MCP prompts |
24
+ | `resource` | `resource/{name}.xs` | MCP resources |
25
25
  | `mcp_server_trigger`| `ai/mcp_server/trigger/{name}.xs` | MCP server event handlers |
26
26
  | `workflow_test` | `workflow_test/{name}.xs` | End-to-end workflow tests |
27
- | `realtime_channel` | `realtime/channel/{name}.xs` | Realtime channel settings |
28
- | `realtime_trigger` | `realtime/trigger/{name}.xs` | Realtime event handlers |
27
+ | `realtime_server` | `realtime/server/{server}/{server}.xs` | Realtime V2 server |
28
+ | `realtime_server_trigger` | `realtime/server/{server}/trigger/{name}.xs` | Realtime V2 connect/disconnect handlers |
29
+ | `channel` | `realtime/server/{server}/channel/{channel}/{channel}.xs` | Realtime V2 channel |
30
+ | `message` | `realtime/server/{server}/channel/{channel}/message/{name}.xs` | Realtime V2 message handlers |
31
+ | `channel_trigger` | `realtime/server/{server}/channel/{channel}/trigger/{name}.xs` | Realtime V2 join/leave/deliver handlers |
32
+ | `realtime_channel` | `realtime/channel/{name}.xs` | Legacy V1 realtime channel settings |
33
+ | `realtime_trigger` | `realtime/trigger/{name}.xs` | Legacy V1 realtime event handlers |
29
34
  | `branch` | `branch.xs` | Branch-level configuration |
30
35
 
31
36
  **Naming convention:** All folder and file names use `snake_case` (e.g., `user_profile.xs`, `get_all_users_get.xs`).
@@ -72,6 +77,10 @@ project/
72
77
  │ ├── my_server.xs # MCP server definitions
73
78
  │ └── trigger/
74
79
  │ └── on_connect.xs # MCP server triggers
80
+ ├── prompt/
81
+ │ └── code_review.xs # MCP prompts
82
+ ├── resource/
83
+ │ └── order_docs.xs # MCP resources
75
84
  ├── workflow_test/
76
85
  │ └── checkout_flow.xs # End-to-end workflow tests
77
86
  ├── middleware/
@@ -79,10 +88,18 @@ project/
79
88
  ├── addon/
80
89
  │ └── user_posts.xs # Query addons
81
90
  ├── realtime/
91
+ │ ├── server/
92
+ │ │ └── chat/
93
+ │ │ ├── chat.xs # Realtime V2 server
94
+ │ │ └── channel/
95
+ │ │ └── rooms_room_id/ # Channel "rooms/{room_id}"
96
+ │ │ ├── rooms_room_id.xs
97
+ │ │ └── message/
98
+ │ │ └── send.xs # Realtime V2 messages
82
99
  │ ├── channel/
83
- │ │ └── chat_room.xs # Realtime channels
100
+ │ │ └── chat_room.xs # Legacy V1 realtime channels
84
101
  │ └── trigger/
85
- │ └── on_message.xs # Realtime triggers
102
+ │ └── on_message.xs # Legacy V1 realtime triggers
86
103
  ├── static/ # Frontend files (HTML, CSS, JS)
87
104
  └── run/ # Job and service configurations
88
105
  ```
@@ -268,7 +285,7 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
268
285
  | ------------ | ---------------------------------------------------------------------- | ------------ |
269
286
  | `workspace` | Workspace-level settings: environment variables, preferences, realtime | Env Variables, Preferences |
270
287
  | `branch` | Branch-level settings: middleware, history retention, visual styling | Middleware Config, History |
271
- | `middleware` | Request/response interceptors for functions, queries, tasks, and tools | Pre/Post Hooks |
288
+ | `middleware` | Request/response interceptors for functions, queries, tasks, tools, realtime messages, and MCP prompts and resources | Pre/Post Hooks |
272
289
  | `policies` | Workspace policy documents: syntax, check catalogue, templates, authoring rules | Quick Reference, Permissions |
273
290
  | `policy-templates` | The platform's policy templates: key, title, checks, framework tags and what each leaves to fill, with an example; recipes for goals that take several; what no check can see | Using a template, Recipes, What no check can see |
274
291
 
@@ -20,10 +20,12 @@ branch "<name>" {
20
20
  ### Attributes
21
21
  | Attribute | Type | Required | Description |
22
22
  |-----------|------|----------|-------------|
23
- | `color` | text | Yes | Hex color code for branch identification |
23
+ | `color` | text | No | Hex color code for branch identification (a pull omits it when unset) |
24
24
  | `description` | text | No | Human-readable branch description |
25
- | `middleware` | object | No | Pre/post middleware configuration |
26
- | `history` | object | No | Request history retention settings |
25
+ | `middleware` | object | Yes | Pre/post middleware; `function`, `query`, `task` and `tool` are required |
26
+ | `history` | object | Yes | Trace retention; `function`, `query`, `task`, `tool`, `trigger` and `middleware` are required |
27
+
28
+ A pull always writes both `middleware` and `history`, so a branch file needs them even when every list is empty.
27
29
 
28
30
  ---
29
31
 
@@ -33,6 +35,23 @@ branch "<name>" {
33
35
  branch "production" {
34
36
  color = "#22c55e"
35
37
  description = "Production environment"
38
+
39
+ middleware = {
40
+ function: {pre: [], post: []},
41
+ query: {pre: [], post: []},
42
+ task: {pre: [], post: []},
43
+ tool: {pre: [], post: []},
44
+ message: {pre: [], post: []}
45
+ }
46
+
47
+ history = {
48
+ function: 100,
49
+ query: 100,
50
+ task: 100,
51
+ tool: 100,
52
+ trigger: 100,
53
+ middleware: 100
54
+ }
36
55
  }
37
56
  ```
38
57
 
@@ -40,7 +59,7 @@ branch "production" {
40
59
 
41
60
  ## Middleware Configuration
42
61
 
43
- Configure middleware to run before (pre) and after (post) different construct types.
62
+ Configure middleware to run before (pre) and after (post) different construct types. Each entry is an object naming a middleware: `{name: "auth_check"}`. Add `active: false` to keep an entry in place but skip it. A list of plain strings is not accepted.
44
63
 
45
64
  ### Syntax
46
65
 
@@ -50,22 +69,43 @@ branch "production" {
50
69
 
51
70
  middleware = {
52
71
  function: {
53
- pre: ["auth_check", "rate_limit"],
54
- post: ["audit_log"]
72
+ pre: [{name: "auth_check"}, {name: "rate_limit"}],
73
+ post: [{name: "audit_log"}]
55
74
  },
56
75
  query: {
57
- pre: ["auth_check", "rate_limit"],
58
- post: ["audit_log", "cache_response"]
76
+ pre: [{name: "auth_check"}, {name: "rate_limit"}],
77
+ post: [{name: "audit_log"}, {name: "cache_response", active: false}]
59
78
  },
60
79
  task: {
61
- pre: ["task_lock"],
62
- post: ["task_cleanup"]
80
+ pre: [{name: "task_lock"}],
81
+ post: [{name: "task_cleanup"}]
63
82
  },
64
83
  tool: {
65
- pre: ["tool_auth"],
66
- post: ["tool_log"]
84
+ pre: [{name: "tool_auth"}],
85
+ post: [{name: "tool_log"}]
86
+ },
87
+ message: {
88
+ pre: [{name: "auth_check"}],
89
+ post: []
90
+ },
91
+ prompt: {
92
+ pre: [{name: "tool_auth"}],
93
+ post: []
94
+ },
95
+ resource: {
96
+ pre: [{name: "tool_auth"}],
97
+ post: []
67
98
  }
68
99
  }
100
+
101
+ history = {
102
+ function: 100,
103
+ query: 100,
104
+ task: 100,
105
+ tool: 100,
106
+ trigger: 100,
107
+ middleware: 100
108
+ }
69
109
  }
70
110
  ```
71
111
 
@@ -73,10 +113,15 @@ branch "production" {
73
113
 
74
114
  | Target | Description |
75
115
  |--------|-------------|
76
- | `function` | Applies to all function calls |
77
- | `query` | Applies to all API endpoints |
78
- | `task` | Applies to scheduled tasks |
79
- | `tool` | Applies to AI agent tools |
116
+ | `function` | Applies to all function calls (required) |
117
+ | `query` | Applies to all API endpoints (required) |
118
+ | `task` | Applies to scheduled tasks (required) |
119
+ | `tool` | Applies to AI agent and MCP tools (required) |
120
+ | `message` | Applies to realtime messages |
121
+ | `prompt` | Applies to MCP prompts (optional) |
122
+ | `resource` | Applies to MCP resources (optional) |
123
+
124
+ A pull writes the `prompt` and `resource` lines only when the branch has middleware for them. A missing target means no branch middleware for that type.
80
125
 
81
126
  ### Pre vs Post Middleware
82
127
 
@@ -85,11 +130,22 @@ branch "production" {
85
130
  | `pre` | Before main logic | Authentication, rate limiting, validation |
86
131
  | `post` | After main logic | Logging, caching, response transformation |
87
132
 
133
+ ### Which Middleware Runs
134
+
135
+ Pre and post are resolved separately. The first level that sets its own list wins, even if that list is empty:
136
+
137
+ 1. The object's own `middleware` block
138
+ 2. Its container: the API group for a query; the MCP server a tool, prompt or resource was reached through; the channel, then its realtime server, for a message
139
+ 3. The branch's list for that type (`query`, `prompt`, ...)
140
+ 4. The workspace's list, only when the object's branch cannot be resolved
141
+
142
+ Entries with `active: false` are skipped.
143
+
88
144
  ---
89
145
 
90
146
  ## History Configuration
91
147
 
92
- Control how many statements from the execution trace are retained per request. Execution traces are kept for 24 hours; this setting limits how many stack statements are recorded in each trace.
148
+ Control how many statements from the execution trace are retained per request. `function`, `query`, `task`, `tool`, `trigger` and `middleware` are required. Execution traces are kept for 24 hours; this setting limits how many stack statements are recorded in each trace.
93
149
 
94
150
  ### Syntax
95
151
 
@@ -97,13 +153,22 @@ Control how many statements from the execution trace are retained per request. E
97
153
  branch "production" {
98
154
  color = "#22c55e"
99
155
 
156
+ middleware = {
157
+ function: {pre: [], post: []},
158
+ query: {pre: [], post: []},
159
+ task: {pre: [], post: []},
160
+ tool: {pre: [], post: []}
161
+ }
162
+
100
163
  history = {
101
164
  function: 100,
102
165
  query: 1000,
103
166
  task: 100,
104
167
  tool: 100,
105
168
  trigger: 100,
106
- middleware: 10
169
+ middleware: 10,
170
+ prompt: 100,
171
+ resource: false
107
172
  }
108
173
  }
109
174
  ```
@@ -113,6 +178,7 @@ branch "production" {
113
178
  | Value | Description |
114
179
  |-------|-------------|
115
180
  | `false` | Disable history (no statements recorded) |
181
+ | `0` | Record no statements (a pull writes `task: 0` when task history is off) |
116
182
  | `10` | Record up to 10 statements per trace |
117
183
  | `100` | Record up to 100 statements per trace |
118
184
  | `1000` | Record up to 1000 statements per trace |
@@ -129,6 +195,10 @@ branch "production" {
129
195
  | `tool` | Statement limit for AI tool traces |
130
196
  | `trigger` | Statement limit for trigger traces |
131
197
  | `middleware` | Statement limit for middleware traces |
198
+ | `prompt` | Statement limit for MCP prompt traces (optional) |
199
+ | `resource` | Statement limit for MCP resource traces (optional) |
200
+
201
+ `prompt` and `resource` default to `100`. A pull writes them only when they differ from that default. An MCP server whose history settings do not inherit overrides the branch for its tools, prompts and resources.
132
202
 
133
203
  ---
134
204
 
@@ -141,6 +211,13 @@ branch "development" {
141
211
  color = "#3b82f6"
142
212
  description = "Development environment with full debugging"
143
213
 
214
+ middleware = {
215
+ function: {pre: [], post: []},
216
+ query: {pre: [], post: []},
217
+ task: {pre: [], post: []},
218
+ tool: {pre: [], post: []}
219
+ }
220
+
144
221
  history = {
145
222
  function: "all",
146
223
  query: "all",
@@ -160,10 +237,13 @@ branch "staging" {
160
237
  description = "Staging environment for testing"
161
238
 
162
239
  middleware = {
240
+ function: {pre: [], post: []},
163
241
  query: {
164
- pre: ["auth_check"],
165
- post: ["audit_log"]
166
- }
242
+ pre: [{name: "auth_check"}],
243
+ post: [{name: "audit_log"}]
244
+ },
245
+ task: {pre: [], post: []},
246
+ tool: {pre: [], post: []}
167
247
  }
168
248
 
169
249
  history = {
@@ -186,20 +266,20 @@ branch "production" {
186
266
 
187
267
  middleware = {
188
268
  function: {
189
- pre: ["auth_check", "rate_limit"],
190
- post: ["audit_log"]
269
+ pre: [{name: "auth_check"}, {name: "rate_limit"}],
270
+ post: [{name: "audit_log"}]
191
271
  },
192
272
  query: {
193
- pre: ["auth_check", "rate_limit", "security_check"],
194
- post: ["audit_log", "cache_response"]
273
+ pre: [{name: "auth_check"}, {name: "rate_limit"}, {name: "security_check"}],
274
+ post: [{name: "audit_log"}, {name: "cache_response"}]
195
275
  },
196
276
  task: {
197
- pre: ["task_lock"],
198
- post: ["audit_log"]
277
+ pre: [{name: "task_lock"}],
278
+ post: [{name: "audit_log"}]
199
279
  },
200
280
  tool: {
201
- pre: ["auth_check"],
202
- post: ["audit_log"]
281
+ pre: [{name: "auth_check"}],
282
+ post: [{name: "audit_log"}]
203
283
  }
204
284
  }
205
285
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- applyTo: "function/**/*.xs, api/**/*.xs, task/*.xs, ai/tool/*.xs, ai/prompt/*.xs, ai/resource/*.xs"
2
+ applyTo: "function/**/*.xs, api/**/*.xs, task/*.xs, ai/tool/*.xs, ai/prompt/*.xs, ai/resource/*.xs, prompt/**/*.xs, resource/**/*.xs"
3
3
  ---
4
4
 
5
5
  # Database Operations
@@ -288,6 +288,8 @@ db.add "product" {
288
288
  } as $product
289
289
  ```
290
290
 
291
+ `data = {}` is valid on `db.add`, `db.edit` and `db.add_or_edit`; a pull writes it when the statement sets no fields.
292
+
291
293
  ---
292
294
 
293
295
  ## db.edit
@@ -507,6 +509,9 @@ db.external.mssql.direct_query { ... }
507
509
 
508
510
  // Oracle
509
511
  db.external.oracle.direct_query { ... }
512
+
513
+ // Snowflake
514
+ db.external.snowflake.direct_query { ... }
510
515
  ```
511
516
 
512
517
  ---
@@ -71,7 +71,7 @@
71
71
  "types": {
72
72
  "file": "types.md",
73
73
  "description": "Data types, input blocks, and validation",
74
- "applyTo": ["function/**/*.xs", "api/**/*.xs", "ai/tool/*.xs", "ai/agent/*.xs", "ai/prompt/*.xs", "ai/resource/*.xs"],
74
+ "applyTo": ["function/**/*.xs", "api/**/*.xs", "ai/tool/*.xs", "ai/agent/*.xs", "ai/prompt/*.xs", "ai/resource/*.xs", "prompt/**/*.xs", "resource/**/*.xs"],
75
75
  "priority": 5,
76
76
  "aliases": ["validation", "input", "data-types"]
77
77
  },
@@ -105,7 +105,7 @@
105
105
  },
106
106
  "triggers": {
107
107
  "file": "triggers.md",
108
- "description": "Event-driven handlers (table, realtime, workspace, agent, MCP)",
108
+ "description": "Event-driven handlers (table, realtime, workspace, agent, MCP, error)",
109
109
  "applyTo": ["*/trigger/*.xs", "ai/*/trigger/*.xs", "realtime/trigger/*.xs"],
110
110
  "priority": 3,
111
111
  "aliases": ["events", "hooks", "handlers"]
@@ -113,7 +113,7 @@
113
113
  "database": {
114
114
  "file": "database.md",
115
115
  "description": "All db.* operations: query, get, add, edit, patch, increment, delete",
116
- "applyTo": ["function/**/*.xs", "api/**/*.xs", "task/*.xs", "ai/tool/*.xs", "ai/prompt/*.xs", "ai/resource/*.xs"],
116
+ "applyTo": ["function/**/*.xs", "api/**/*.xs", "task/*.xs", "ai/tool/*.xs", "ai/prompt/*.xs", "ai/resource/*.xs", "prompt/**/*.xs", "resource/**/*.xs"],
117
117
  "priority": 5,
118
118
  "aliases": ["db", "crud", "query", "sql"]
119
119
  },
@@ -141,14 +141,14 @@
141
141
  "prompts": {
142
142
  "file": "prompts.md",
143
143
  "description": "MCP prompts: reusable prompt templates an MCP server offers, with arguments and completions",
144
- "applyTo": ["ai/prompt/*.xs"],
144
+ "applyTo": ["ai/prompt/*.xs", "prompt/**/*.xs"],
145
145
  "priority": 3,
146
146
  "aliases": ["prompt", "mcp-prompts"]
147
147
  },
148
148
  "resources": {
149
149
  "file": "resources.md",
150
150
  "description": "MCP resources: static and URI-template resources an MCP server shares as context",
151
- "applyTo": ["ai/resource/*.xs"],
151
+ "applyTo": ["ai/resource/*.xs", "resource/**/*.xs"],
152
152
  "priority": 3,
153
153
  "aliases": ["resource", "mcp-resources", "resource-templates"]
154
154
  },
@@ -258,7 +258,10 @@
258
258
  "channel/**/*.xs",
259
259
  "message/**/*.xs",
260
260
  "channel_trigger/**/*.xs",
261
- "realtime_server_trigger/**/*.xs"
261
+ "realtime_server_trigger/**/*.xs",
262
+ "realtime/server/**/*.xs",
263
+ "realtime/channel_trigger/*.xs",
264
+ "realtime/server_trigger/*.xs"
262
265
  ],
263
266
  "priority": 3,
264
267
  "aliases": [
@@ -390,6 +393,7 @@
390
393
  "workspace_trigger": { "file": "triggers.md", "section": "workspace-trigger" },
391
394
  "agent_trigger": { "file": "triggers.md", "section": "agent-trigger" },
392
395
  "mcp_server_trigger": { "file": "triggers.md", "section": "mcp-server-trigger" },
396
+ "error_trigger": { "file": "triggers.md", "section": "error-trigger" },
393
397
  "addon": { "file": "addons.md" },
394
398
  "middleware": { "file": "middleware.md" },
395
399
  "realtime_channel": { "file": "realtime.md" },
@@ -332,6 +332,48 @@ conditional {
332
332
 
333
333
  ---
334
334
 
335
+ ## Syntax a Pull Writes
336
+
337
+ ### Disabled Statements
338
+
339
+ A leading `!` disables a statement, an `elseif` branch or a switch `case`: it stays in the stack but never runs. A pull writes disabled ones this way.
340
+
341
+ ```xs
342
+ !debug.log { value = "skipped" }
343
+
344
+ switch ($input.status) {
345
+ case ("active") {
346
+ var $message { value = "User is active" }
347
+ } break
348
+ !case ("legacy") {
349
+ var $message { value = "Legacy status" }
350
+ } break
351
+ default {
352
+ var $message { value = "Unknown status" }
353
+ }
354
+ }
355
+ ```
356
+
357
+ ### Quoting Text
358
+
359
+ `'...'` strings are valid, including for `description`, `docs`, `instructions`, `title`, `tags` and enum `values`; a pull writes a value that contains `"` that way. `"""` blocks hold multiline text.
360
+
361
+ ```xs
362
+ function "greet" {
363
+ description = 'Says "hello" to the caller'
364
+ input {
365
+ }
366
+
367
+ stack {
368
+ }
369
+
370
+ response = null
371
+ tags = ['greeting', 'say "hi"']
372
+ }
373
+ ```
374
+
375
+ ---
376
+
335
377
  ## Common Patterns
336
378
 
337
379
  ### 1. Input Validation
@@ -21,7 +21,7 @@ This topic covers uploading files **to Xano's own private/public storage** (the
21
21
  | Viewing a **private** file | `storage.sign_private_url` (pathname + ttl, one arg per line) | reading `.path` directly (returns HTTP 403) |
22
22
  | Viewing a **public** file | instance base URL `~ $stored_file.path` (no signing) | `storage.sign_private_url` (works but is unnecessary) |
23
23
  | Multiple-file form field | append as `field[]` (e.g. `photos[]`) | append repeatedly as `photos` (only the last file is kept) |
24
- | Required `storage.*` args | always pass `value`, `access`, **and** `filename` | omitting `access` or `filename` (validation error) |
24
+ | Required `storage.*` args | pass `value` and `access` (`filename` is optional) | omitting `access` on `create_attachment`/`create_image` (validation error) |
25
25
  | Frontend `Content-Type` | let the browser set it | manually setting `multipart/form-data` |
26
26
 
27
27
  ## The Core Rule: `file?`, not `image?`
@@ -53,7 +53,7 @@ file[] my_files
53
53
 
54
54
  ## Storage Operations
55
55
 
56
- All `storage.create_*` operations require three arguments — `value`, `access`, and `filename` — written one per line (block arguments are newline-separated; commas are only used inside object literals like `data = { ... }`).
56
+ `storage.create_attachment` and `storage.create_image` require `value` and `access`; `filename` is optional on every `storage.create_*` (a pull omits it when unset), and `access` is optional on `create_audio` and `create_video`. Write one argument per line (block arguments are newline-separated; commas are only used inside object literals like `data = { ... }`).
57
57
 
58
58
  ### `storage.create_attachment` — any file type (recommended default)
59
59
 
@@ -383,7 +383,7 @@ storage.create_attachment {
383
383
  } as $f
384
384
  ```
385
385
 
386
- ❌ **Omitting `access` or `filename`** — `storage.create_attachment { value = $input.photo } as $f` fails validation with `Missing required argument 'access'`. Always pass all three.
386
+ ❌ **Omitting `access`** — `storage.create_attachment { value = $input.photo } as $f` fails validation with `Missing required argument 'access'`.
387
387
 
388
388
  ❌ **Comma-separated or commented op args** — `storage.create_attachment { value = ..., filename = ... }` and a comment inside the `{ }` are both parse errors. One argument per line, comments on their own line outside the block.
389
389
 
@@ -393,7 +393,7 @@ storage.create_attachment {
393
393
  |-------|--------|-------|-----|
394
394
  | `Missing param: path` (`ERROR_CODE_INPUT_ERROR`, `payload.param` ends in `.path`) | 400 | Input declared `image?`/`video?`/`audio?`/`attachment?` — Xano doesn't set `.path` on the raw upload object | Change input type to `file?` |
395
395
  | `Invalid file extension.` (`ERROR_FATAL`) | 500 | `storage.create_image` with a non-image (PDF, HEIC, …) | Use `storage.create_attachment` |
396
- | `Missing required argument 'access'` (validation, at push time) | — | A `storage.create_*` call omitted `access` (or `filename`) | Pass `value`, `access`, and `filename` |
396
+ | `Missing required argument 'access'` (validation, at push time) | — | A `storage.create_attachment` or `storage.create_image` call omitted `access` | Pass `value` and `access` |
397
397
  | HTTP 403 when fetching a file's `.path` | 403 | The file is `private`; raw paths aren't public | Generate `storage.sign_private_url`, or store the file as `public` |
398
398
  | Multiple upload stored only one file | — | Multipart field appended without the `[]` suffix | Append files as `field[]` (e.g. `photos[]`) |
399
399
 
@@ -150,7 +150,7 @@ the server is exported.
150
150
 
151
151
  ## Prompts and Resources Blocks
152
152
 
153
- First-class prompts (`ai/prompt/`) and resources (`ai/resource/`) are attached the same way as tools. These blocks exist on `mcp_server` only; an `agent` cannot have them.
153
+ First-class prompts (pulled to `prompt/`) and resources (pulled to `resource/`) are attached the same way as tools. These blocks exist on `mcp_server` only; an `agent` cannot have them.
154
154
 
155
155
  ```xs
156
156
  mcp_server "Orders" {
@@ -164,7 +164,7 @@ mcp_server "Orders" {
164
164
  }
165
165
  ```
166
166
 
167
- Each entry takes `name` (required, the file name), `active` (default `true`) and `auth` (an auth-enabled table name; omitted = public). A client only sees, fetches and completes the prompts and resources attached to the server it connected to.
167
+ Each entry takes `name` (required, the prompt or resource declaration name), `active` (default `true`) and `auth` (an auth-enabled table name; omitted = public). A client only sees, fetches and completes the prompts and resources attached to the server it connected to.
168
168
 
169
169
  ---
170
170
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- applyTo: "ai/prompt/*.xs"
2
+ applyTo: "ai/prompt/*.xs, prompt/**/*.xs"
3
3
  ---
4
4
 
5
5
  # Prompts
@@ -80,6 +80,8 @@ prompt code_review {
80
80
 
81
81
  An input field that is required and has no default becomes a required prompt argument. A client that omits one gets an error before the stack runs.
82
82
 
83
+ Without its own `middleware` block, a prompt reached through an MCP server uses that server's middleware, as a tool does. Past the server it uses the branch's `prompt` middleware (see `branch`). Without its own `history` setting, it follows the server's history override, then the branch's `prompt` history setting.
84
+
83
85
  ---
84
86
 
85
87
  ## What `response` May Return
@@ -137,7 +139,7 @@ mcp_server "Engineering" {
137
139
 
138
140
  | Entry field | Purpose | Default |
139
141
  |-------------|---------|---------|
140
- | `name` | Prompt file name in `ai/prompt/` | (required) |
142
+ | `name` | The prompt's declaration name (`prompt code_review`) | (required) |
141
143
  | `active` | Whether this server offers the prompt | `true` |
142
144
  | `auth` | Name of an auth-enabled table whose token is required to fetch it | omitted = public |
143
145
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- applyTo: "realtime_server/**/*.xs, channel/**/*.xs, message/**/*.xs, channel_trigger/**/*.xs, realtime_server_trigger/**/*.xs"
2
+ applyTo: "realtime_server/**/*.xs, channel/**/*.xs, message/**/*.xs, channel_trigger/**/*.xs, realtime_server_trigger/**/*.xs, realtime/server/**/*.xs, realtime/channel_trigger/*.xs, realtime/server_trigger/*.xs"
3
3
  ---
4
4
 
5
5
  # Realtime V2
@@ -64,6 +64,8 @@ The declaration names the template `rooms/{room_id}`; a client joins a resolved
64
64
  | `publish.direct` | Whether clients may address other clients directly |
65
65
  | `delivery.guarantee` | The example uses `at_most_once`; delivery may be lost |
66
66
 
67
+ Optional `description`, `docs` and `tags` document a channel; a pull writes each only when it is set.
68
+
67
69
  A room path separates subscriptions; knowing a path is not authorization. Use access policy and a join trigger for restricted rooms.
68
70
 
69
71
  ### Message handler
@@ -371,7 +373,7 @@ xano workspace push --profile YOUR_PROFILE --workspace YOUR_WORKSPACE --branch Y
371
373
  xano workspace pull --profile YOUR_PROFILE --workspace YOUR_WORKSPACE --branch YOUR_BRANCH --directory pulled-workspace
372
374
  ```
373
375
 
374
- Validate with `xano_validate_xanoscript` before pushing. Pull back and verify server canonicals, channel settings, message parent references, and trigger inputs. Use a current CLI release with Realtime V2 support. V2 objects pull under `realtime_server/`, `channel/`, `message/`, and `channel_trigger/`. Keep explicit parent clauses: folder names do not replace them.
376
+ Validate with `xano_validate_xanoscript` before pushing. Pull back and verify server canonicals, channel settings, message parent references, and trigger inputs. Use a current CLI release with Realtime V2 support. The CLI pulls V2 objects under `realtime/server/<server>/`: the server's own file, `trigger/` for its triggers, and `channel/<channel>/` holding the channel file, `message/` and `trigger/`. Push reads the documents, not the folders, so a hand-made layout such as this example's flat `realtime_server/`, `channel/` and `message/` folders also works. Keep explicit parent clauses: folder names do not replace them.
375
377
 
376
378
  If working from the source repository, run `node examples/realtime-v2/verify.mjs` with the frontend config pointed at your deployed examples. Set `XANO_TEST_USER_TOKEN` to an application user JWT to include the authenticated positive test. The script reports that test as skipped if the token is absent.
377
379
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- applyTo: "ai/resource/*.xs"
2
+ applyTo: "ai/resource/*.xs, resource/**/*.xs"
3
3
  ---
4
4
 
5
5
  # Resources
@@ -96,6 +96,8 @@ Reading `orders://eu/42` binds `region = "eu"` and `order_id = 42`, converted to
96
96
 
97
97
  The declaration name (`resource regional_order`) is the resource's name. It is never its uri.
98
98
 
99
+ Without its own `middleware` block, a resource reached through an MCP server uses that server's middleware, as a tool does. Past the server it uses the branch's `resource` middleware (see `branch`). Without its own `history` setting, it follows the server's history override, then the branch's `resource` history setting.
100
+
99
101
  ---
100
102
 
101
103
  ## URI Rules
@@ -162,4 +162,4 @@ If the project has a `policies/` folder, the branch has governance policies. Kee
162
162
 
163
163
  ### Available Topics
164
164
 
165
- survival, working, readme, essentials, syntax, syntax/string-filters, syntax/array-filters, syntax/functions, types, database, functions, apis, tables, tasks, triggers, agents, tools, mcp-servers, security, performance, debugging, unit-testing, workflow-tests, middleware, addons, realtime, streaming, schema, integrations, integrations/cloud-storage, integrations/search, integrations/redis, integrations/external-apis, integrations/utilities, workspace, branch, run, frontend, policies
165
+ survival, working, readme, essentials, syntax, syntax/string-filters, syntax/array-filters, syntax/functions, types, database, functions, apis, tables, tasks, triggers, agents, tools, mcp-servers, prompts, resources, security, performance, debugging, unit-testing, workflow-tests, middleware, addons, realtime, realtime-v2, streaming, schema, integrations, integrations/cloud-storage, integrations/search, integrations/redis, integrations/external-apis, integrations/utilities, workspace, branch, run, frontend, policies
@@ -113,6 +113,20 @@ schema {
113
113
  }
114
114
  ```
115
115
 
116
+ ### Quoted Names
117
+
118
+ A column name that is not an identifier is written quoted, as a pull writes it:
119
+
120
+ ```xs
121
+ schema {
122
+ int id
123
+ text "my-col"
124
+ timestamp "created-at"?=now
125
+ }
126
+ ```
127
+
128
+ Prefer identifier names (`created_at`) for new columns.
129
+
116
130
  ### Foreign Keys
117
131
 
118
132
  ```xs
@@ -243,6 +257,50 @@ Required for vector similarity searches via `cosine_distance` in `db.query`. Pos
243
257
 
244
258
  ---
245
259
 
260
+ ## Views
261
+
262
+ Saved views of the table's data in Studio. Each key is the view name; each view needs an `id` and at least one of `term`, `search`, `sort` or `hide`. A pull writes `alias`, `term`, `search`, `sort` and `hide` only when the view has them.
263
+
264
+ ```xs
265
+ table "customer" {
266
+ auth = false
267
+ schema {
268
+ int id
269
+ text name
270
+ email email
271
+ text notes?
272
+ }
273
+
274
+ index = [
275
+ {type: "primary", field: [{name: "id"}]}
276
+ ]
277
+
278
+ view = {
279
+ "Gmail customers": {
280
+ term: "gmail"
281
+ sort: {id: "desc"}
282
+ id: "9ed7daad-682f-455e-bf02-ca53444cd429"
283
+ }
284
+ "Without notes": {
285
+ alias: "Contact columns"
286
+ hide: ["notes"]
287
+ id: "4c1f6e0a-2b7d-4f39-9a51-3e8d2c7b6a10"
288
+ }
289
+ }
290
+ }
291
+ ```
292
+
293
+ | Key | Description |
294
+ |-----|-------------|
295
+ | `id` | View id (required) |
296
+ | `alias` | Display name |
297
+ | `term` | Quick-search text |
298
+ | `search` | Filter expression |
299
+ | `sort` | `{field: "asc" \| "desc" \| "rand"}` |
300
+ | `hide` | Columns hidden in the view |
301
+
302
+ ---
303
+
246
304
  ## Complete Examples
247
305
 
248
306
  ### User Table (with auth)
@@ -129,7 +129,7 @@ tool lookup_order {
129
129
 
130
130
  ### `title`
131
131
 
132
- A human readable name, e.g. `"Look up an order"`. The tool name stays the identifier.
132
+ A human readable name, e.g. `"Look up an order"`. The tool name stays the identifier. A pull writes a title containing `"` as `'...'` and one containing a newline as a `"""` block; both are valid, as on prompts and resources.
133
133
 
134
134
  ### `annotations`
135
135
 
@@ -4,9 +4,9 @@ applyTo: "*/trigger/*.xs, ai/*/trigger/*.xs, realtime/trigger/*.xs"
4
4
 
5
5
  # Triggers
6
6
 
7
- Event-driven handlers that execute in response to system events. Triggers allow you to react to database changes, real-time messages, workspace events, agent connections, and MCP server tool calls.
7
+ Event-driven handlers that execute in response to system events. Triggers allow you to react to database changes, real-time messages, workspace events, agent connections, MCP server tool calls, and captured errors.
8
8
 
9
- > **TL;DR:** Triggers respond to events. Types: `table_trigger` (CRUD events), `realtime_trigger` (channel events), `workspace_trigger` (branch events), `agent_trigger` (AI events), `mcp_server_trigger` (MCP events). Each has predefined input blocks.
9
+ > **TL;DR:** Triggers respond to events. Types: `table_trigger` (CRUD events), `realtime_trigger` (channel events), `workspace_trigger` (branch events), `agent_trigger` (AI events), `mcp_server_trigger` (MCP events), `error_trigger` (error signature events). Each has predefined input blocks.
10
10
 
11
11
  ## Section Index
12
12
 
@@ -19,6 +19,7 @@ Event-driven handlers that execute in response to system events. Triggers allow
19
19
  | [Workspace Trigger](#workspace-trigger) | Branch lifecycle event handlers |
20
20
  | [Agent Trigger](#agent-trigger) | AI agent event handlers |
21
21
  | [MCP Server Trigger](#mcp-server-trigger) | MCP tool call handlers |
22
+ | [Error Trigger](#error-trigger) | Captured error event handlers |
22
23
  | [Common Patterns](#common-patterns) | Error handling, conditional logic |
23
24
  | [Best Practices](#best-practices) | Guidelines for trigger development |
24
25
 
@@ -31,6 +32,7 @@ Event-driven handlers that execute in response to system events. Triggers allow
31
32
  | `workspace_trigger` | React to branch lifecycle events | `input`, `stack` |
32
33
  | `agent_trigger` | Handle AI agent connections | `agent`, `input`, `stack`, `response` |
33
34
  | `mcp_server_trigger` | Handle MCP server tool calls | `mcp_server`, `input`, `stack`, `response` |
35
+ | `error_trigger` | React to new, regressed and fixed errors | `input`, `stack` |
34
36
 
35
37
  ---
36
38
 
@@ -555,7 +557,9 @@ mcp_server_trigger "<name>" {
555
557
 
556
558
  | Action | Description |
557
559
  |--------|-------------|
558
- | `connection` | Trigger on MCP connection events (required) |
560
+ | `connection` | Trigger on MCP connection events |
561
+
562
+ A pull writes only the actions that are on, so a trigger with connection off is written `actions = {}`.
559
563
 
560
564
  ### Example
561
565
 
@@ -589,6 +593,132 @@ mcp_server_trigger "database_tool_handler" {
589
593
 
590
594
  ---
591
595
 
596
+ ## Error Trigger
597
+
598
+ Runs when the workspace's error log records an error signature event. `active = false` pauses it; a pull writes `active` only when the trigger is paused.
599
+
600
+ ### Syntax
601
+
602
+ ```xs
603
+ error_trigger "<name>" {
604
+ description = "Description of this trigger"
605
+ active = false
606
+
607
+ // Uses the predefined error trigger input - see the Example
608
+ input { ... }
609
+
610
+ stack {
611
+ // Logic to execute when triggered
612
+ }
613
+
614
+ tags = ["tag1", "tag2"]
615
+ history = false
616
+ }
617
+ ```
618
+
619
+ ### Required Clauses
620
+
621
+ | Clause | Description |
622
+ |--------|-------------|
623
+ | `input` | Predefined input block (read-only) |
624
+ | `stack` | Logic to execute when triggered |
625
+
626
+ ### Optional Clauses
627
+
628
+ | Clause | Type | Description |
629
+ |--------|------|-------------|
630
+ | `active` | boolean | `false` pauses the trigger (default `true`) |
631
+ | `description` | string | Short description |
632
+ | `history` | integer/string/boolean | History retention setting |
633
+ | `tags` | array | Tags for organization |
634
+
635
+ ### Events
636
+
637
+ | `$input.event` | Fires when |
638
+ |----------------|------------|
639
+ | `new` | A signature is first captured, and again on each snapshot re-capture (about every 5 minutes) unless the signature is ignored |
640
+ | `regression` | A signature marked fixed occurs again |
641
+ | `fixed` | A user marks a signature fixed (`caller` and `statement` are null; `actor` is set) |
642
+
643
+ ### Example
644
+
645
+ A paused trigger; delete `active = false` to turn it on. The input block is the one a pull writes, with descriptions omitted.
646
+
647
+ ```xs
648
+ error_trigger "notify_on_error" {
649
+ description = "Post new and regressed errors to the team channel"
650
+
651
+ active = false
652
+
653
+ input {
654
+ enum event {
655
+ values = ["new", "regression", "fixed"]
656
+ }
657
+
658
+ int id
659
+ text signature
660
+ object error {
661
+ schema {
662
+ text code
663
+ text message
664
+ }
665
+ }
666
+
667
+ object? caller {
668
+ schema {
669
+ text type
670
+ int id
671
+ text? name
672
+ }
673
+ }
674
+
675
+ object? statement {
676
+ schema {
677
+ text name
678
+ text xsid
679
+ }
680
+ }
681
+
682
+ object? actor {
683
+ schema {
684
+ int id
685
+ text? name
686
+ }
687
+ }
688
+
689
+ object count {
690
+ schema {
691
+ int total
692
+ int last_hour
693
+ }
694
+ }
695
+
696
+ text first_seen
697
+ text last_seen
698
+ text? fixed_at
699
+ }
700
+
701
+ stack {
702
+ conditional {
703
+ if ($input.event != "fixed") {
704
+ api.request {
705
+ url = $env.SLACK_WEBHOOK_URL
706
+ method = "POST"
707
+ params = {text: $input.event ~ ": " ~ $input.error.message ~ " (" ~ $input.count.total ~ " total)"}
708
+ } as $notify
709
+ }
710
+ }
711
+ }
712
+
713
+ tags = ["alerts"]
714
+ history = false
715
+ }
716
+ ```
717
+
718
+ `caller.type` is `api`, `function`, `task`, `middleware`, `trigger` or `unknown`. `id` is the error signature's id, `first_seen`, `last_seen` and `fixed_at` are ISO-8601 UTC timestamps.
719
+
720
+ ---
721
+
592
722
  ## Best Practices
593
723
 
594
724
  1. **Use predefined input blocks as-is** - Each trigger type has a read-only input block that cannot be modified
@@ -1,5 +1,5 @@
1
1
  ---
2
- applyTo: "function/**/*.xs, api/**/*.xs, ai/tool/*.xs, ai/agent/*.xs, ai/prompt/*.xs, ai/resource/*.xs"
2
+ applyTo: "function/**/*.xs, api/**/*.xs, ai/tool/*.xs, ai/agent/*.xs, ai/prompt/*.xs, ai/resource/*.xs, prompt/**/*.xs, resource/**/*.xs"
3
3
  ---
4
4
 
5
5
  # Types & Inputs
@@ -100,6 +100,19 @@ input { email email_input? filters=trim|lower text name }
100
100
 
101
101
  Access inputs in stack: `$input.username`, `$input.age`
102
102
 
103
+ ### Quoted Names
104
+
105
+ A name that is not an identifier is written quoted, as a pull writes it. Read it with brackets:
106
+
107
+ ```xs
108
+ input {
109
+ text "my-col"
110
+ timestamp "created-at"?=now
111
+ }
112
+ ```
113
+
114
+ Access: `$input["my-col"]`, `$input["created-at"]`. Prefer identifier names for new inputs.
115
+
103
116
  ---
104
117
 
105
118
  ## Type Details
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "2.8.0",
3
- "updated": "2026-09-28"
2
+ "version": "2.9.1",
3
+ "updated": "2026-10-21"
4
4
  }
@@ -39,6 +39,7 @@ Call functions invoke Xano constructs and capture their results. Each returns a
39
39
  | `task.call` | Call a task | — |
40
40
  | `tool.call` | Call a tool | — |
41
41
  | `trigger.call` | Call a trigger | `input` with `new`, `old`, `action`, `datasource` |
42
+ | `workflow_test.call` | Run another workflow test | optional `datasource` |
42
43
 
43
44
  ### api.call
44
45
 
@@ -93,6 +94,20 @@ trigger.call "<trigger_name>" {
93
94
  } as $result
94
95
  ```
95
96
 
97
+ ### workflow_test.call
98
+
99
+ Runs another workflow test as a step. Valid only inside a `workflow_test`.
100
+
101
+ ```xs
102
+ workflow_test.call "<workflow_test_name>" {
103
+ datasource = "staging"
104
+ } as $result
105
+ ```
106
+
107
+ - The call binds the target's outcome instead of raising it: `null` when the target passes, `{code, message}` when it fails. Assert on the binding, or wrap the call in `expect.to_throw` to require a failure.
108
+ - `datasource` is optional; a pull writes it only when set. The common statement attributes `description`, `disabled` and `mock` are also accepted.
109
+ - A test cannot call itself or a test already running earlier in the chain (the call fails with `already running earlier in this chain`), and the call is refused inside a `db.transaction`.
110
+
96
111
  ---
97
112
 
98
113
  ## Assertions
@@ -249,6 +264,9 @@ workflow_test "comprehensive_test" {
249
264
  input = {new: {}, old: {}, action: "", datasource: ""}
250
265
  } as $trigger1
251
266
 
267
+ workflow_test.call "my_other_test" as $chained1
268
+ expect.to_be_null ($chained1)
269
+
252
270
  // No-property assertions
253
271
  expect.to_be_defined ($endpoint1)
254
272
  expect.to_be_empty ($addon1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/developer-mcp",
3
- "version": "2.3.0-beta.6",
3
+ "version": "2.3.0-beta.7",
4
4
  "description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
5
5
  "mcpName": "io.github.xano-inc/xano-developer-mcp",
6
6
  "type": "module",