@xano/developer-mcp 1.0.26 → 1.0.27

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.
Files changed (75) hide show
  1. package/dist/xanoscript_docs/README.md +78 -64
  2. package/dist/xanoscript_docs/apis.md +81 -27
  3. package/dist/xanoscript_docs/branch.md +13 -13
  4. package/dist/xanoscript_docs/database.md +57 -17
  5. package/dist/xanoscript_docs/functions.md +43 -71
  6. package/dist/xanoscript_docs/performance.md +14 -23
  7. package/dist/xanoscript_docs/tables.md +47 -1
  8. package/dist/xanoscript_docs/tools.md +9 -7
  9. package/dist/xanoscript_docs/types.md +12 -10
  10. package/package.json +1 -1
  11. package/dist/api_docs/format.d.ts +0 -5
  12. package/dist/api_docs/format.js +0 -171
  13. package/dist/api_docs/index.d.ts +0 -52
  14. package/dist/api_docs/index.js +0 -111
  15. package/dist/api_docs/topics/agent.d.ts +0 -2
  16. package/dist/api_docs/topics/agent.js +0 -142
  17. package/dist/api_docs/topics/api.d.ts +0 -2
  18. package/dist/api_docs/topics/api.js +0 -176
  19. package/dist/api_docs/topics/apigroup.d.ts +0 -2
  20. package/dist/api_docs/topics/apigroup.js +0 -124
  21. package/dist/api_docs/topics/authentication.d.ts +0 -2
  22. package/dist/api_docs/topics/authentication.js +0 -61
  23. package/dist/api_docs/topics/branch.d.ts +0 -2
  24. package/dist/api_docs/topics/branch.js +0 -73
  25. package/dist/api_docs/topics/file.d.ts +0 -2
  26. package/dist/api_docs/topics/file.js +0 -70
  27. package/dist/api_docs/topics/function.d.ts +0 -2
  28. package/dist/api_docs/topics/function.js +0 -164
  29. package/dist/api_docs/topics/history.d.ts +0 -2
  30. package/dist/api_docs/topics/history.js +0 -149
  31. package/dist/api_docs/topics/mcp_server.d.ts +0 -2
  32. package/dist/api_docs/topics/mcp_server.js +0 -139
  33. package/dist/api_docs/topics/middleware.d.ts +0 -2
  34. package/dist/api_docs/topics/middleware.js +0 -156
  35. package/dist/api_docs/topics/realtime.d.ts +0 -2
  36. package/dist/api_docs/topics/realtime.js +0 -112
  37. package/dist/api_docs/topics/start.d.ts +0 -2
  38. package/dist/api_docs/topics/start.js +0 -107
  39. package/dist/api_docs/topics/table.d.ts +0 -2
  40. package/dist/api_docs/topics/table.js +0 -195
  41. package/dist/api_docs/topics/task.d.ts +0 -2
  42. package/dist/api_docs/topics/task.js +0 -165
  43. package/dist/api_docs/topics/tool.d.ts +0 -2
  44. package/dist/api_docs/topics/tool.js +0 -150
  45. package/dist/api_docs/topics/workflows.d.ts +0 -2
  46. package/dist/api_docs/topics/workflows.js +0 -131
  47. package/dist/api_docs/topics/workspace.d.ts +0 -2
  48. package/dist/api_docs/topics/workspace.js +0 -153
  49. package/dist/api_docs/types.d.ts +0 -79
  50. package/dist/api_docs/types.js +0 -4
  51. package/dist/templates/init-workspace.d.ts +0 -10
  52. package/dist/templates/init-workspace.js +0 -278
  53. package/dist/templates/xanoscript-index.d.ts +0 -11
  54. package/dist/templates/xanoscript-index.js +0 -72
  55. package/dist/xanoscript_docs/ephemeral.md +0 -330
  56. package/dist/xanoscript_docs_auto/README.md +0 -119
  57. package/dist/xanoscript_docs_auto/agents.md +0 -446
  58. package/dist/xanoscript_docs_auto/apis.md +0 -517
  59. package/dist/xanoscript_docs_auto/control-flow.md +0 -543
  60. package/dist/xanoscript_docs_auto/database.md +0 -551
  61. package/dist/xanoscript_docs_auto/debugging.md +0 -527
  62. package/dist/xanoscript_docs_auto/filters.md +0 -464
  63. package/dist/xanoscript_docs_auto/functions.md +0 -431
  64. package/dist/xanoscript_docs_auto/integrations.md +0 -657
  65. package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
  66. package/dist/xanoscript_docs_auto/operators.md +0 -368
  67. package/dist/xanoscript_docs_auto/syntax.md +0 -287
  68. package/dist/xanoscript_docs_auto/tables.md +0 -447
  69. package/dist/xanoscript_docs_auto/tasks.md +0 -479
  70. package/dist/xanoscript_docs_auto/testing.md +0 -574
  71. package/dist/xanoscript_docs_auto/tools.md +0 -485
  72. package/dist/xanoscript_docs_auto/triggers.md +0 -595
  73. package/dist/xanoscript_docs_auto/types.md +0 -323
  74. package/dist/xanoscript_docs_auto/variables.md +0 -462
  75. package/dist/xanoscript_docs_auto/version.json +0 -5
@@ -4,21 +4,21 @@ XanoScript is the declarative scripting language for [Xano](https://xano.com), a
4
4
 
5
5
  ## Quick Reference
6
6
 
7
- | Construct | File Location | Purpose |
8
- |-----------|---------------|---------|
9
- | `table` | `tables/*.xs` | Database schema definition |
10
- | `function` | `functions/**/*.xs` | Reusable logic blocks |
11
- | `query` | `apis/<group>/*.xs` | HTTP API endpoints |
12
- | `task` | `tasks/*.xs` | Scheduled/cron jobs |
13
- | `*_trigger` | `triggers/**/*.xs` | Event-driven handlers |
14
- | `agent` | `agents/**/*.xs` | AI-powered agents |
15
- | `tool` | `tools/**/*.xs` | Tools for AI agents |
16
- | `mcp_server` | `mcp_servers/**/*.xs` | MCP server definitions |
17
- | `addon` | `addons/*.xs` | Subqueries for related data |
18
- | `middleware` | `middleware/**/*.xs` | Request/response interceptors |
19
- | `branch` | `branch.xs` | Branch-level configuration |
20
- | `workspace` | `workspace.xs` | Workspace-level configuration |
21
- | `realtime_channel` | Configuration | Realtime channel settings |
7
+ | Construct | File Location | Purpose |
8
+ | ------------------ | --------------------- | ----------------------------- |
9
+ | `table` | `tables/*.xs` | Database schema definition |
10
+ | `function` | `functions/**/*.xs` | Reusable logic blocks |
11
+ | `query` | `apis/<group>/*.xs` | HTTP API endpoints |
12
+ | `task` | `tasks/*.xs` | Scheduled/cron jobs |
13
+ | `*_trigger` | `triggers/**/*.xs` | Event-driven handlers |
14
+ | `agent` | `agents/**/*.xs` | AI-powered agents |
15
+ | `tool` | `tools/**/*.xs` | Tools for AI agents |
16
+ | `mcp_server` | `mcp_servers/**/*.xs` | MCP server definitions |
17
+ | `addon` | `addons/*.xs` | Subqueries for related data |
18
+ | `middleware` | `middleware/**/*.xs` | Request/response interceptors |
19
+ | `branch` | `branch.xs` | Branch-level configuration |
20
+ | `workspace` | `workspace.xs` | Workspace-level configuration |
21
+ | `realtime_channel` | Configuration | Realtime channel settings |
22
22
 
23
23
  **Important:** Each `.xs` file must contain exactly one definition. You cannot define multiple tables, functions, queries, or other constructs in a single file.
24
24
 
@@ -47,21 +47,22 @@ project/
47
47
 
48
48
  Access with `$env.<name>`. Built-in variables:
49
49
 
50
- | Variable | Description |
51
- |----------|-------------|
52
- | `$env.$remote_ip` | Client IP address |
53
- | `$env.$http_headers` | Request headers array |
54
- | `$env.$request_uri` | Request URI |
55
- | `$env.$request_method` | HTTP method (GET, POST, etc.) |
56
- | `$env.$request_querystring` | Query string |
57
- | `$env.$datasource` | Current datasource |
58
- | `$env.$branch` | Current branch |
50
+ | Variable | Description |
51
+ | --------------------------- | ----------------------------- |
52
+ | `$env.$remote_ip` | Client IP address |
53
+ | `$env.$http_headers` | Request headers array |
54
+ | `$env.$request_uri` | Request URI |
55
+ | `$env.$request_method` | HTTP method (GET, POST, etc.) |
56
+ | `$env.$request_querystring` | Query string |
57
+ | `$env.$datasource` | Current datasource |
58
+ | `$env.$branch` | Current branch |
59
59
 
60
60
  Custom environment variables are set in the Xano dashboard and accessed as `$env.MY_VAR`.
61
61
 
62
62
  ## Core Syntax Patterns
63
63
 
64
64
  ### Block Structure
65
+
65
66
  ```xs
66
67
  <construct> "<name>" {
67
68
  input { ... } // Parameters (optional)
@@ -71,6 +72,7 @@ Custom environment variables are set in the Xano dashboard and accessed as `$env
71
72
  ```
72
73
 
73
74
  ### Variable Access
75
+
74
76
  ```xs
75
77
  $input.field // Input parameters
76
78
  $var.field // Stack variables
@@ -83,14 +85,18 @@ $this // Current item in loops/maps
83
85
  **Note:** `$response` is a reserved word and cannot be used as a variable name.
84
86
 
85
87
  ### Comments
88
+
86
89
  ```xs
87
90
  // Single-line comment
88
- var $total { value = 0 } // Inline comment
91
+ var $total {
92
+ value = 0
93
+ }
89
94
  ```
90
95
 
91
96
  **Note:** XanoScript only supports `//` for comments. Other comment styles like `#` are not supported.
92
97
 
93
98
  ### Filters (Pipe Syntax)
99
+
94
100
  ```xs
95
101
  $value|trim|lower // Chain filters
96
102
  $input.name|strlen // Get length
@@ -115,58 +121,66 @@ This helps AI tools apply the correct documentation based on the file being edit
115
121
  Use `xanoscript_docs({ topic: "<topic>" })` to retrieve documentation.
116
122
 
117
123
  ### Core Language
118
- | Topic | Description |
119
- |-------|-------------|
120
- | `syntax` | Expressions, operators, filters, system variables |
121
- | `types` | Data types, validation, input blocks |
122
- | `functions` | Reusable function stacks, async, loops |
123
- | `schema` | Runtime schema parsing and validation |
124
+
125
+ | Topic | Description |
126
+ | ----------- | ------------------------------------------------- |
127
+ | `syntax` | Expressions, operators, filters, system variables |
128
+ | `types` | Data types, validation, input blocks |
129
+ | `functions` | Reusable function stacks, async, loops |
130
+ | `schema` | Runtime schema parsing and validation |
124
131
 
125
132
  ### Data
126
- | Topic | Description |
127
- |-------|-------------|
128
- | `tables` | Database schema definitions with indexes and relationships |
129
- | `database` | All db.* operations: query, get, add, edit, patch, delete |
130
- | `addons` | Reusable subqueries for fetching related data |
131
- | `streaming` | Streaming data from files, requests, and responses |
133
+
134
+ | Topic | Description |
135
+ | ----------- | ---------------------------------------------------------- |
136
+ | `tables` | Database schema definitions with indexes and relationships |
137
+ | `database` | All db.\* operations: query, get, add, edit, patch, delete |
138
+ | `addons` | Reusable subqueries for fetching related data |
139
+ | `streaming` | Streaming data from files, requests, and responses |
132
140
 
133
141
  ### APIs & Endpoints
134
- | Topic | Description |
135
- |-------|-------------|
136
- | `apis` | HTTP endpoint definitions with authentication and CRUD patterns |
137
- | `tasks` | Scheduled and cron jobs |
138
- | `triggers` | Event-driven handlers (table, realtime, workspace, agent, MCP) |
139
- | `realtime` | Real-time channels and events for push updates |
142
+
143
+ | Topic | Description |
144
+ | ---------- | --------------------------------------------------------------- |
145
+ | `apis` | HTTP endpoint definitions with authentication and CRUD patterns |
146
+ | `tasks` | Scheduled and cron jobs |
147
+ | `triggers` | Event-driven handlers (table, realtime, workspace, agent, MCP) |
148
+ | `realtime` | Real-time channels and events for push updates |
140
149
 
141
150
  ### AI & Agents
142
- | Topic | Description |
143
- |-------|-------------|
144
- | `agents` | AI agent configuration with LLM providers and tools |
145
- | `tools` | AI tools for agents and MCP servers |
146
- | `mcp-servers` | MCP server definitions exposing tools |
151
+
152
+ | Topic | Description |
153
+ | ------------- | --------------------------------------------------- |
154
+ | `agents` | AI agent configuration with LLM providers and tools |
155
+ | `tools` | AI tools for agents and MCP servers |
156
+ | `mcp-servers` | MCP server definitions exposing tools |
147
157
 
148
158
  ### Integrations
149
- | Topic | Description |
150
- |-------|-------------|
159
+
160
+ | Topic | Description |
161
+ | -------------- | ------------------------------------------------- |
151
162
  | `integrations` | Cloud storage, Redis, security, and external APIs |
152
163
 
153
164
  ### Configuration
154
- | Topic | Description |
155
- |-------|-------------|
156
- | `workspace` | Workspace-level settings: environment variables, preferences, realtime |
157
- | `branch` | Branch-level settings: middleware, history retention, visual styling |
165
+
166
+ | Topic | Description |
167
+ | ------------ | ---------------------------------------------------------------------- |
168
+ | `workspace` | Workspace-level settings: environment variables, preferences, realtime |
169
+ | `branch` | Branch-level settings: middleware, history retention, visual styling |
158
170
  | `middleware` | Request/response interceptors for functions, queries, tasks, and tools |
159
171
 
160
172
  ### Development
161
- | Topic | Description |
162
- |-------|-------------|
163
- | `testing` | Unit tests, mocks, and assertions |
164
- | `debugging` | Logging, inspecting, and debugging XanoScript execution |
165
- | `frontend` | Static frontend development and deployment |
166
- | `run` | Run job and service configurations for the Xano Job Runner |
173
+
174
+ | Topic | Description |
175
+ | ----------- | ---------------------------------------------------------- |
176
+ | `testing` | Unit tests, mocks, and assertions |
177
+ | `debugging` | Logging, inspecting, and debugging XanoScript execution |
178
+ | `frontend` | Static frontend development and deployment |
179
+ | `run` | Run job and service configurations for the Xano Job Runner |
167
180
 
168
181
  ### Best Practices
169
- | Topic | Description |
170
- |-------|-------------|
171
- | `performance` | Performance optimization best practices |
172
- | `security` | Security best practices for authentication and authorization |
182
+
183
+ | Topic | Description |
184
+ | ------------- | ------------------------------------------------------------ |
185
+ | `performance` | Performance optimization best practices |
186
+ | `security` | Security best practices for authentication and authorization |
@@ -12,7 +12,7 @@ HTTP endpoint definitions in XanoScript.
12
12
  query "endpoint-path" verb=<METHOD> {
13
13
  api_group = "<GroupName>" // Required: API group for organization
14
14
  description = "What this endpoint does"
15
- auth = "<table>" // Optional: require authentication
15
+ auth = "<table>" // Optional: table with auth = true (usually "user")
16
16
  input { ... }
17
17
  stack { ... }
18
18
  response = $result
@@ -24,16 +24,19 @@ query "endpoint-path" verb=<METHOD> {
24
24
  The query name is **required** and **must be a non-empty string**. Empty names (`query "" verb=...`) are invalid. The name defines the endpoint path after the API group canonical.
25
25
 
26
26
  **Full URL path structure:**
27
+
27
28
  ```
28
29
  /<api_group canonical>/<query name>
29
30
  ```
30
31
 
31
32
  The query name can include slashes for nested paths:
33
+
32
34
  - `query "list" verb=GET` → `/<canonical>/list`
33
35
  - `query "users/{id}" verb=GET` → `/<canonical>/users/{id}`
34
36
  - `query "admin/reports/daily" verb=GET` → `/<canonical>/admin/reports/daily`
35
37
 
36
38
  ### HTTP Methods
39
+
37
40
  `GET`, `POST`, `PUT`, `PATCH`, `DELETE`
38
41
 
39
42
  ### API Groups (Required)
@@ -41,25 +44,50 @@ The query name can include slashes for nested paths:
41
44
  Every endpoint must belong to an API group. Each group is a folder with an `api_group.xs` file:
42
45
 
43
46
  ```xs
47
+ // Minimal definition
44
48
  api_group "users" {
45
- canonical = "users" // Required: URL path segment
49
+ canonical = "myapp-users" // Required: URL path segment (unique at instance level)
46
50
  description = "User management" // Optional
47
51
  }
48
52
  ```
49
53
 
54
+ **Full definition with all options:**
55
+
56
+ ```xs
57
+ api_group Authentication {
58
+ active = false // Disable group (cannot be externally invoked)
59
+ canonical = "plmgzl-s" // Required: unique at instance level
60
+ swagger = {token: "cbO83nMTt7BVgq3QcQgKikDfHeo"} // Protect Swagger docs behind a token (plain text)
61
+ tags = ["auth", "security", "encrypted"] // Tags for organization
62
+ history = 100 // Request history: up to 100 statements per request
63
+ }
64
+ ```
65
+
66
+ | Property | Type | Required | Description |
67
+ | ------------- | ------ | -------- | --------------------------------------------------------------------------- |
68
+ | `canonical` | text | Yes | URL path segment, must be unique at the instance level |
69
+ | `description` | text | No | Human-readable description |
70
+ | `active` | bool | No | Whether the group accepts external requests (default: `true`) |
71
+ | `swagger` | object | No | Swagger documentation settings. `token` protects access (stored plain text) |
72
+ | `tags` | list | No | Tags for organization and filtering |
73
+ | `history` | int | No | Max number of statements recorded per request for debugging |
74
+
75
+ **Canonical uniqueness:** A Xano instance can host multiple workspaces. The `canonical` is used to route requests between workspaces and must be **unique at the instance level**, not just within your workspace. Use a descriptive, project-specific prefix to avoid collisions (e.g., `myapp-users` instead of `users`). A generic name like `user` is likely to conflict with another workspace's canonical on the same instance.
76
+
50
77
  ### File Structure
78
+
51
79
  ```
52
80
  apis/
53
81
  ├── users/
54
- │ ├── api_group.xs // Defines group (canonical = "users")
55
- │ ├── list.xs // GET /users/list
56
- │ └── by-id.xs // GET/PATCH/DELETE /users/{id}
82
+ │ ├── api_group.xs // Defines group (canonical = "myapp-users")
83
+ │ ├── list.xs // GET /myapp-users/list
84
+ │ └── by-id.xs // GET/PATCH/DELETE /myapp-users/{id}
57
85
  └── products/
58
- ├── api_group.xs // Defines group (canonical = "products")
59
- └── search.xs // GET /products/search
86
+ ├── api_group.xs // Defines group (canonical = "myapp-products")
87
+ └── search.xs // GET /myapp-products/search
60
88
  ```
61
89
 
62
- Full URL: `/<canonical>/<query name>` (e.g., `/users/profile`)
90
+ Full URL: `/<canonical>/<query name>` (e.g., `/myapp-users/profile`)
63
91
 
64
92
  ---
65
93
 
@@ -88,22 +116,24 @@ query "products" verb=GET {
88
116
 
89
117
  For complete type and filter reference, use `xanoscript_docs({ topic: "types" })`.
90
118
 
91
- ### Empty Input Blocks
119
+ ### Empty and Single-Input Blocks
92
120
 
93
- **CRITICAL:** When an endpoint has no input parameters, the input block braces MUST be on separate lines. `input {}` on a single line will cause parsing errors.
121
+ Empty input blocks and single-input blocks can be written as one-liners. When there are two or more inputs, each must be on its own line.
94
122
 
95
123
  ```xs
96
- // CORRECT - braces on separate lines
124
+ // OK - empty input
97
125
  query "health" verb=GET {
98
126
  api_group = "System"
99
- input {
100
- }
127
+ input {}
101
128
  stack { ... }
102
129
  response = { status: "ok" }
103
130
  }
104
131
 
105
- // WRONG - causes parsing errors
106
- input {}
132
+ // OK - single input as one-liner
133
+ input { text query filters=trim }
134
+
135
+ // WRONG - multiple inputs on one line will cause parsing errors
136
+ input { text query filters=trim int limit }
107
137
  ```
108
138
 
109
139
  ---
@@ -111,6 +141,7 @@ input {}
111
141
  ## Authentication
112
142
 
113
143
  ### Public Endpoint (default)
144
+
114
145
  ```xs
115
146
  query "status" verb=GET {
116
147
  api_group = "System"
@@ -120,10 +151,13 @@ query "status" verb=GET {
120
151
  ```
121
152
 
122
153
  ### Authenticated Endpoint
154
+
155
+ The `auth` attribute references a table that has `auth = true` in its definition (see [tables.md](tables.md)). This is typically the `user` table. While multiple auth tables are supported, it's recommended to use a single auth table and control access levels with a role flag or RBAC pattern.
156
+
123
157
  ```xs
124
158
  query "profile" verb=GET {
125
159
  api_group = "Users"
126
- auth = "user" // Requires valid JWT
160
+ auth = "user" // Must reference a table with auth = true
127
161
  stack {
128
162
  db.get "user" {
129
163
  field_name = "id"
@@ -135,6 +169,8 @@ query "profile" verb=GET {
135
169
  ```
136
170
 
137
171
  When `auth` is set:
172
+
173
+ - The referenced table must have `auth = true` in its table definition
138
174
  - Endpoint requires Bearer token in `Authorization` header
139
175
  - `$auth.id` contains authenticated user's ID
140
176
  - Invalid/missing token returns 401
@@ -143,21 +179,26 @@ When `auth` is set:
143
179
 
144
180
  ## Path Parameters
145
181
 
146
- Use `{param}` in the path:
182
+ Use `{param}` in the path and capture its value in the input block:
147
183
 
148
184
  ```xs
149
185
  query "users/{user_id}" verb=GET {
150
- api_group = "Users"
186
+ api_group = "Authentication"
151
187
  auth = "user"
188
+
152
189
  input {
153
- int user_id { table = "user" }
190
+ int user_id {
191
+ table = "user"
192
+ }
154
193
  }
194
+
155
195
  stack {
156
196
  db.get "user" {
157
197
  field_name = "id"
158
198
  field_value = $input.user_id
159
199
  } as $user
160
200
  }
201
+
161
202
  response = $user
162
203
  }
163
204
  ```
@@ -167,6 +208,7 @@ query "users/{user_id}" verb=GET {
167
208
  ## CRUD Examples
168
209
 
169
210
  ### List (GET)
211
+
170
212
  ```xs
171
213
  query "products" verb=GET {
172
214
  api_group = "Products"
@@ -187,6 +229,7 @@ query "products" verb=GET {
187
229
  ```
188
230
 
189
231
  ### Create (POST)
232
+
190
233
  ```xs
191
234
  query "products" verb=POST {
192
235
  api_group = "Products"
@@ -213,6 +256,7 @@ query "products" verb=POST {
213
256
  ```
214
257
 
215
258
  ### Read (GET with ID)
259
+
216
260
  ```xs
217
261
  query "products/{product_id}" verb=GET {
218
262
  api_group = "Products"
@@ -235,6 +279,7 @@ query "products/{product_id}" verb=GET {
235
279
  ```
236
280
 
237
281
  ### Update (PATCH)
282
+
238
283
  ```xs
239
284
  query "products/{product_id}" verb=PATCH {
240
285
  api_group = "Products"
@@ -250,15 +295,19 @@ query "products/{product_id}" verb=PATCH {
250
295
 
251
296
  conditional {
252
297
  if ($input.name != null) {
253
- var.update $updates { value = $updates|set:"name":$input.name }
298
+ var.update $updates.name { value = $input.name }
254
299
  }
255
300
  }
256
301
  conditional {
257
302
  if ($input.price != null) {
258
- var.update $updates { value = $updates|set:"price":$input.price }
303
+ var.update $updates.price { value = $input.price }
259
304
  }
260
305
  }
261
306
 
307
+ precondition (($updates|is_empty) == false) {
308
+ error = "No updates provided"
309
+ }
310
+
262
311
  db.patch "product" {
263
312
  field_name = "id"
264
313
  field_value = $input.product_id
@@ -270,6 +319,7 @@ query "products/{product_id}" verb=PATCH {
270
319
  ```
271
320
 
272
321
  ### Delete (DELETE)
322
+
273
323
  ```xs
274
324
  query "products/{product_id}" verb=DELETE {
275
325
  api_group = "Products"
@@ -292,11 +342,13 @@ query "products/{product_id}" verb=DELETE {
292
342
  ## Response Types
293
343
 
294
344
  ### JSON (default)
345
+
295
346
  ```xs
296
347
  response = $data
297
348
  ```
298
349
 
299
350
  ### HTML
351
+
300
352
  ```xs
301
353
  stack {
302
354
  util.set_header {
@@ -316,6 +368,7 @@ response = $html
316
368
  ```
317
369
 
318
370
  ### Streaming
371
+
319
372
  ```xs
320
373
  stack {
321
374
  api.stream { value = $processed_data }
@@ -347,12 +400,12 @@ stack {
347
400
 
348
401
  For complete error handling reference, use `xanoscript_docs({ topic: "syntax" })`.
349
402
 
350
- | Type | HTTP Status |
351
- |------|-------------|
352
- | `inputerror` | 400 |
353
- | `accessdenied` | 403 |
354
- | `notfound` | 404 |
355
- | `standard` | 500 |
403
+ | Type | HTTP Status |
404
+ | -------------- | ----------- |
405
+ | `inputerror` | 400 |
406
+ | `accessdenied` | 403 |
407
+ | `notfound` | 404 |
408
+ | `standard` | 500 |
356
409
 
357
410
  ---
358
411
 
@@ -381,3 +434,4 @@ When using `return = { type: "list", paging: {...} }`:
381
434
  3. **Authenticate writes** - Always require auth for POST/PATCH/DELETE
382
435
  4. **Paginate lists** - Never return unbounded result sets
383
436
  5. **Group by resource** - Organize endpoints in logical api groups
437
+ 6. **Use specific canonicals** - Prefix canonicals to avoid instance-level collisions (e.g., `myapp-users` not `users`)
@@ -89,7 +89,7 @@ branch "production" {
89
89
 
90
90
  ## History Configuration
91
91
 
92
- Control how many historical executions are retained for debugging and auditing.
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.
93
93
 
94
94
  ### Syntax
95
95
 
@@ -112,23 +112,23 @@ branch "production" {
112
112
 
113
113
  | Value | Description |
114
114
  |-------|-------------|
115
- | `false` | Disable history (no retention) |
116
- | `10` | Keep last 10 executions |
117
- | `100` | Keep last 100 executions |
118
- | `1000` | Keep last 1000 executions |
119
- | `10000` | Keep last 10000 executions |
120
- | `"all"` | Keep all executions (use with caution) |
115
+ | `false` | Disable history (no statements recorded) |
116
+ | `10` | Record up to 10 statements per trace |
117
+ | `100` | Record up to 100 statements per trace |
118
+ | `1000` | Record up to 1000 statements per trace |
119
+ | `10000` | Record up to 10000 statements per trace |
120
+ | `"all"` | Record all statements (use with caution) |
121
121
 
122
122
  ### History Targets
123
123
 
124
124
  | Target | Description |
125
125
  |--------|-------------|
126
- | `function` | Function execution history |
127
- | `query` | API endpoint request history |
128
- | `task` | Scheduled task execution history |
129
- | `tool` | AI tool invocation history |
130
- | `trigger` | Trigger execution history |
131
- | `middleware` | Middleware execution history |
126
+ | `function` | Statement limit for function traces |
127
+ | `query` | Statement limit for API endpoint traces |
128
+ | `task` | Statement limit for scheduled task traces |
129
+ | `tool` | Statement limit for AI tool traces |
130
+ | `trigger` | Statement limit for trigger traces |
131
+ | `middleware` | Statement limit for middleware traces |
132
132
 
133
133
  ---
134
134