@xano/developer-mcp 1.0.26 → 1.0.28
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.
- package/README.md +1 -1
- package/dist/meta_api_docs/topics/workspace.js +45 -2
- package/dist/xanoscript_docs/README.md +71 -67
- package/dist/xanoscript_docs/apis.md +81 -27
- package/dist/xanoscript_docs/branch.md +13 -13
- package/dist/xanoscript_docs/database.md +57 -17
- package/dist/xanoscript_docs/functions.md +29 -78
- package/dist/xanoscript_docs/integrations.md +0 -10
- package/dist/xanoscript_docs/performance.md +15 -33
- package/dist/xanoscript_docs/realtime.md +1 -48
- package/dist/xanoscript_docs/security.md +2 -0
- package/dist/xanoscript_docs/tables.md +47 -1
- package/dist/xanoscript_docs/tools.md +2 -19
- package/dist/xanoscript_docs/triggers.md +2 -27
- package/dist/xanoscript_docs/types.md +12 -10
- package/package.json +1 -1
|
@@ -23,9 +23,11 @@ table "<name>" {
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### Field Types
|
|
26
|
+
|
|
26
27
|
`int`, `text`, `email`, `password`, `decimal`, `bool`, `timestamp`, `date`, `uuid`, `vector`, `json`, `image`, `video`, `audio`, `attachment`, `enum`
|
|
27
28
|
|
|
28
29
|
### Index Types
|
|
30
|
+
|
|
29
31
|
`primary`, `btree`, `btree|unique`, `gin`
|
|
30
32
|
|
|
31
33
|
---
|
|
@@ -58,6 +60,7 @@ table "user" {
|
|
|
58
60
|
## Schema Fields
|
|
59
61
|
|
|
60
62
|
### Basic Fields
|
|
63
|
+
|
|
61
64
|
```xs
|
|
62
65
|
schema {
|
|
63
66
|
int id
|
|
@@ -70,6 +73,7 @@ schema {
|
|
|
70
73
|
```
|
|
71
74
|
|
|
72
75
|
### Optional & Defaults
|
|
76
|
+
|
|
73
77
|
```xs
|
|
74
78
|
schema {
|
|
75
79
|
text nickname? // Optional, no default
|
|
@@ -80,6 +84,7 @@ schema {
|
|
|
80
84
|
```
|
|
81
85
|
|
|
82
86
|
### With Filters
|
|
87
|
+
|
|
83
88
|
```xs
|
|
84
89
|
schema {
|
|
85
90
|
text name filters=trim
|
|
@@ -90,6 +95,7 @@ schema {
|
|
|
90
95
|
```
|
|
91
96
|
|
|
92
97
|
### With Metadata
|
|
98
|
+
|
|
93
99
|
```xs
|
|
94
100
|
schema {
|
|
95
101
|
text ssn {
|
|
@@ -104,6 +110,7 @@ schema {
|
|
|
104
110
|
```
|
|
105
111
|
|
|
106
112
|
### Foreign Keys
|
|
113
|
+
|
|
107
114
|
```xs
|
|
108
115
|
schema {
|
|
109
116
|
int user_id {
|
|
@@ -117,6 +124,7 @@ schema {
|
|
|
117
124
|
```
|
|
118
125
|
|
|
119
126
|
### Enum Fields
|
|
127
|
+
|
|
120
128
|
```xs
|
|
121
129
|
schema {
|
|
122
130
|
enum status {
|
|
@@ -129,6 +137,7 @@ schema {
|
|
|
129
137
|
```
|
|
130
138
|
|
|
131
139
|
### JSON Fields
|
|
140
|
+
|
|
132
141
|
```xs
|
|
133
142
|
schema {
|
|
134
143
|
json metadata
|
|
@@ -137,17 +146,24 @@ schema {
|
|
|
137
146
|
```
|
|
138
147
|
|
|
139
148
|
### Vector Fields
|
|
149
|
+
|
|
140
150
|
```xs
|
|
141
151
|
schema {
|
|
142
|
-
vector embedding //
|
|
152
|
+
vector embedding // Required vector field
|
|
153
|
+
vector? embeddings? { // Optional vector field with explicit size
|
|
154
|
+
size = 768
|
|
155
|
+
}
|
|
143
156
|
}
|
|
144
157
|
```
|
|
145
158
|
|
|
159
|
+
The `size` parameter specifies the vector dimensions (must match your embedding model's output). Pair with a vector index for similarity search (see [Vector Index](#vector-index) below).
|
|
160
|
+
|
|
146
161
|
---
|
|
147
162
|
|
|
148
163
|
## Indexes
|
|
149
164
|
|
|
150
165
|
### Primary Key
|
|
166
|
+
|
|
151
167
|
```xs
|
|
152
168
|
index = [
|
|
153
169
|
{type: "primary", field: [{name: "id"}]}
|
|
@@ -155,6 +171,7 @@ index = [
|
|
|
155
171
|
```
|
|
156
172
|
|
|
157
173
|
### B-tree Index
|
|
174
|
+
|
|
158
175
|
```xs
|
|
159
176
|
index = [
|
|
160
177
|
{type: "btree", field: [{name: "email", op: "asc"}]}
|
|
@@ -163,6 +180,7 @@ index = [
|
|
|
163
180
|
```
|
|
164
181
|
|
|
165
182
|
### Unique Index
|
|
183
|
+
|
|
166
184
|
```xs
|
|
167
185
|
index = [
|
|
168
186
|
{type: "btree|unique", field: [{name: "email"}]}
|
|
@@ -171,6 +189,7 @@ index = [
|
|
|
171
189
|
```
|
|
172
190
|
|
|
173
191
|
### Composite Index
|
|
192
|
+
|
|
174
193
|
```xs
|
|
175
194
|
index = [
|
|
176
195
|
{type: "btree", field: [{name: "user_id"}, {name: "created_at", op: "desc"}]}
|
|
@@ -178,6 +197,7 @@ index = [
|
|
|
178
197
|
```
|
|
179
198
|
|
|
180
199
|
### GIN Index (for JSON/arrays)
|
|
200
|
+
|
|
181
201
|
```xs
|
|
182
202
|
index = [
|
|
183
203
|
{type: "gin", field: [{name: "tags", op: "jsonb_path_op"}]}
|
|
@@ -185,11 +205,35 @@ index = [
|
|
|
185
205
|
]
|
|
186
206
|
```
|
|
187
207
|
|
|
208
|
+
### Full-Text Search Index
|
|
209
|
+
|
|
210
|
+
```xs
|
|
211
|
+
index = [
|
|
212
|
+
{
|
|
213
|
+
name : "search_content"
|
|
214
|
+
lang : "english"
|
|
215
|
+
type : "search"
|
|
216
|
+
field: [{name: "searchable_content", op: "A"}]
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Vector Index
|
|
222
|
+
|
|
223
|
+
```xs
|
|
224
|
+
index = [
|
|
225
|
+
{type: "vector", field: [{name: "embeddings", op: "vector_cosine_ops"}]}
|
|
226
|
+
]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Required for vector similarity searches via `cosine_distance` in `db.query`. PostgreSQL vector indexes only support ascending scans, so queries must sort by distance `asc` to use the index. Sorting `desc` will bypass the index and trigger a full table scan. See [database.md](database.md) for query usage.
|
|
230
|
+
|
|
188
231
|
---
|
|
189
232
|
|
|
190
233
|
## Complete Examples
|
|
191
234
|
|
|
192
235
|
### User Table (with auth)
|
|
236
|
+
|
|
193
237
|
```xs
|
|
194
238
|
table "user" {
|
|
195
239
|
auth = true
|
|
@@ -212,6 +256,7 @@ table "user" {
|
|
|
212
256
|
```
|
|
213
257
|
|
|
214
258
|
### Product Table
|
|
259
|
+
|
|
215
260
|
```xs
|
|
216
261
|
table "product" {
|
|
217
262
|
auth = false
|
|
@@ -235,6 +280,7 @@ table "product" {
|
|
|
235
280
|
```
|
|
236
281
|
|
|
237
282
|
### Order with Foreign Keys
|
|
283
|
+
|
|
238
284
|
```xs
|
|
239
285
|
table "order" {
|
|
240
286
|
auth = false
|
|
@@ -74,25 +74,6 @@ input {
|
|
|
74
74
|
}
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
### Empty Input Blocks
|
|
78
|
-
|
|
79
|
-
**CRITICAL:** When a tool has no input parameters, the input block braces MUST be on separate lines. `input {}` on a single line will cause parsing errors.
|
|
80
|
-
|
|
81
|
-
```xs
|
|
82
|
-
// CORRECT - braces on separate lines
|
|
83
|
-
tool "get_system_status" {
|
|
84
|
-
description = "Get current system status"
|
|
85
|
-
instructions = "Use this to check if the system is healthy"
|
|
86
|
-
input {
|
|
87
|
-
}
|
|
88
|
-
stack { ... }
|
|
89
|
-
response = $status
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// WRONG - causes parsing errors
|
|
93
|
-
input {}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
77
|
---
|
|
97
78
|
|
|
98
79
|
## Tool-Specific Statements
|
|
@@ -273,6 +254,8 @@ tool "get_order_with_items" {
|
|
|
273
254
|
|
|
274
255
|
## Error Handling
|
|
275
256
|
|
|
257
|
+
For complete error handling reference (preconditions, try-catch, throw, error types), see `xanoscript_docs({ topic: "syntax" })`.
|
|
258
|
+
|
|
276
259
|
```xs
|
|
277
260
|
tool "cancel_order" {
|
|
278
261
|
instructions = "Cancel an order. Only works for pending orders."
|
|
@@ -43,34 +43,9 @@ input {
|
|
|
43
43
|
| `action` | enum | The action that triggered: `insert`, `update`, `delete`, or `truncate` |
|
|
44
44
|
| `datasource` | text | The datasource name where the change occurred |
|
|
45
45
|
|
|
46
|
-
### Agent Trigger Input
|
|
46
|
+
### Agent Trigger Input / MCP Server Trigger Input
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
input {
|
|
50
|
-
object toolset {
|
|
51
|
-
schema {
|
|
52
|
-
int id
|
|
53
|
-
text name
|
|
54
|
-
text instructions
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
object[] tools {
|
|
59
|
-
schema {
|
|
60
|
-
int id
|
|
61
|
-
text name
|
|
62
|
-
text instructions
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
| Field | Type | Description |
|
|
69
|
-
|-------|------|-------------|
|
|
70
|
-
| `toolset` | object | The toolset configuration with id, name, and instructions |
|
|
71
|
-
| `tools` | object[] | Array of available tools with their id, name, and instructions |
|
|
72
|
-
|
|
73
|
-
### MCP Server Trigger Input
|
|
48
|
+
Agent triggers and MCP server triggers share the same input schema:
|
|
74
49
|
|
|
75
50
|
```xs
|
|
76
51
|
input {
|
|
@@ -60,23 +60,25 @@ input {
|
|
|
60
60
|
}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
### Empty Input Blocks
|
|
63
|
+
### Empty and Single-Input Blocks
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
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.
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
```xs
|
|
68
|
+
// OK - empty input as one-liner
|
|
69
|
+
input {}
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- Function/API/tool will fail to deploy
|
|
71
|
+
// OK - single input as one-liner
|
|
72
|
+
input { email email_input? filters=trim|lower }
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
// CORRECT - braces on separate lines
|
|
74
|
+
// OK - multiple inputs on separate lines
|
|
75
75
|
input {
|
|
76
|
+
email email_input? filters=trim|lower
|
|
77
|
+
text name
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
// WRONG -
|
|
79
|
-
input {}
|
|
80
|
+
// WRONG - multiple inputs on one line will cause parsing errors
|
|
81
|
+
input { email email_input? filters=trim|lower text name }
|
|
80
82
|
```
|
|
81
83
|
|
|
82
84
|
Access inputs in stack: `$input.username`, `$input.age`
|