@xano/developer-mcp 1.0.1 → 1.0.2

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 (42) hide show
  1. package/README.md +96 -31
  2. package/dist/index.js +248 -180
  3. package/package.json +4 -2
  4. package/xanoscript_docs/README.md +107 -1
  5. package/xanoscript_docs/agents.md +329 -0
  6. package/xanoscript_docs/apis.md +343 -0
  7. package/xanoscript_docs/database.md +417 -0
  8. package/xanoscript_docs/ephemeral.md +333 -0
  9. package/xanoscript_docs/frontend.md +291 -0
  10. package/xanoscript_docs/functions.md +232 -2035
  11. package/xanoscript_docs/integrations.md +439 -0
  12. package/xanoscript_docs/mcp-servers.md +190 -0
  13. package/xanoscript_docs/plan.md +192 -0
  14. package/xanoscript_docs/syntax.md +314 -0
  15. package/xanoscript_docs/tables.md +270 -0
  16. package/xanoscript_docs/tasks.md +254 -0
  17. package/xanoscript_docs/testing.md +335 -0
  18. package/xanoscript_docs/tools.md +305 -0
  19. package/xanoscript_docs/types.md +297 -0
  20. package/xanoscript_docs/version.json +2 -1
  21. package/xanoscript_docs/api_query_examples.md +0 -1255
  22. package/xanoscript_docs/api_query_guideline.md +0 -129
  23. package/xanoscript_docs/build_from_lovable.md +0 -715
  24. package/xanoscript_docs/db_query_guideline.md +0 -427
  25. package/xanoscript_docs/ephemeral_environment_guideline.md +0 -529
  26. package/xanoscript_docs/expression_guideline.md +0 -1086
  27. package/xanoscript_docs/frontend_guideline.md +0 -67
  28. package/xanoscript_docs/function_examples.md +0 -1406
  29. package/xanoscript_docs/function_guideline.md +0 -130
  30. package/xanoscript_docs/input_guideline.md +0 -227
  31. package/xanoscript_docs/mcp_server_examples.md +0 -36
  32. package/xanoscript_docs/mcp_server_guideline.md +0 -69
  33. package/xanoscript_docs/query_filter.md +0 -489
  34. package/xanoscript_docs/table_examples.md +0 -586
  35. package/xanoscript_docs/table_guideline.md +0 -137
  36. package/xanoscript_docs/task_examples.md +0 -511
  37. package/xanoscript_docs/task_guideline.md +0 -103
  38. package/xanoscript_docs/tips_and_tricks.md +0 -144
  39. package/xanoscript_docs/tool_examples.md +0 -69
  40. package/xanoscript_docs/tool_guideline.md +0 -139
  41. package/xanoscript_docs/unit_testing_guideline.md +0 -328
  42. package/xanoscript_docs/workspace.md +0 -17
@@ -0,0 +1,297 @@
1
+ ---
2
+ applyTo: "functions/**/*.xs, apis/**/*.xs, tools/**/*.xs, agents/**/*.xs"
3
+ ---
4
+
5
+ # Types & Inputs
6
+
7
+ Reference for XanoScript data types, input blocks, and validation.
8
+
9
+ ## Quick Reference
10
+
11
+ ### Primitive Types
12
+ | Type | Description | Example |
13
+ |------|-------------|---------|
14
+ | `int` | 32-bit integer | `int user_id` |
15
+ | `decimal` | Floating-point | `decimal price` |
16
+ | `text` | UTF-8 string | `text name filters=trim` |
17
+ | `bool` | Boolean | `bool is_active?=true` |
18
+ | `email` | Validated email | `email contact filters=lower` |
19
+ | `password` | Hashed credential | `password secret` |
20
+ | `uuid` | UUID string | `uuid session_id` |
21
+ | `timestamp` | Epoch ms or ISO | `timestamp created_at` |
22
+ | `date` | YYYY-MM-DD | `date birth_date` |
23
+ | `json` | JSON object/array | `json metadata` |
24
+
25
+ ### Special Types
26
+ | Type | Description |
27
+ |------|-------------|
28
+ | `vector` | Numeric array for embeddings |
29
+ | `enum` | Restricted value set |
30
+ | `object` | Nested schema |
31
+ | `file` / `image` / `video` / `audio` / `attachment` | File resources |
32
+ | `geo_point` / `geo_polygon` / `geo_linestring` | Geographic data |
33
+
34
+ ### Modifiers
35
+ | Syntax | Meaning |
36
+ |--------|---------|
37
+ | `text?` | Nullable (can be null) |
38
+ | `text name?` | Optional (not required) |
39
+ | `text name?="default"` | Optional with default |
40
+ | `text[]` | Array of type |
41
+ | `text[1:10]` | Array with size constraints |
42
+
43
+ ---
44
+
45
+ ## Input Block
46
+
47
+ Define parameters for functions, APIs, and tools:
48
+
49
+ ```xs
50
+ input {
51
+ text username filters=trim {
52
+ description = "User's login name"
53
+ }
54
+ int age? filters=min:0 {
55
+ description = "Optional age"
56
+ }
57
+ text role?="user" {
58
+ description = "Role, defaults to 'user'"
59
+ }
60
+ }
61
+ ```
62
+
63
+ Access inputs in stack: `$input.username`, `$input.age`
64
+
65
+ ---
66
+
67
+ ## Type Details
68
+
69
+ ### text
70
+ ```xs
71
+ text name filters=trim|lower # With filters
72
+ text bio? filters=max:500 # Optional, max 500 chars
73
+ ```
74
+
75
+ ### int / decimal
76
+ ```xs
77
+ int quantity filters=min:0|max:100
78
+ decimal price filters=min:0.01
79
+ ```
80
+
81
+ ### bool
82
+ ```xs
83
+ bool is_active?=true # Defaults to true
84
+ bool confirmed?=false
85
+ ```
86
+
87
+ ### email
88
+ ```xs
89
+ email contact filters=trim|lower {
90
+ sensitive = true
91
+ }
92
+ ```
93
+
94
+ ### password
95
+ ```xs
96
+ password secret filters=min:8 # Minimum 8 characters
97
+ ```
98
+
99
+ ### timestamp / date
100
+ ```xs
101
+ timestamp created_at?=now # Defaults to current time
102
+ date birth_date
103
+ ```
104
+
105
+ ### uuid
106
+ ```xs
107
+ uuid session_id
108
+ uuid user_id { table = "user" } # Foreign key reference
109
+ ```
110
+
111
+ ### json
112
+ ```xs
113
+ json metadata # Any JSON structure
114
+ json settings?={} # Default empty object
115
+ ```
116
+
117
+ ### enum
118
+ ```xs
119
+ enum status {
120
+ values = ["pending", "active", "cancelled"]
121
+ description = "Order status"
122
+ }
123
+
124
+ enum priority?="medium" {
125
+ values = ["low", "medium", "high"]
126
+ }
127
+ ```
128
+
129
+ ### object (Nested Schema)
130
+ ```xs
131
+ object address {
132
+ schema {
133
+ text street filters=trim
134
+ text city filters=trim
135
+ text zip filters=trim
136
+ text country?="US"
137
+ }
138
+ }
139
+ ```
140
+
141
+ ### Arrays
142
+ ```xs
143
+ text[] tags filters=trim|lower # Array of trimmed lowercase strings
144
+ int[1:10] scores filters=min:0|max:100 # 1-10 integers between 0-100
145
+ object[] items {
146
+ schema {
147
+ int id
148
+ text name
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### File Types
154
+ ```xs
155
+ image photo {
156
+ description = "Profile photo"
157
+ }
158
+ attachment document
159
+ video recording
160
+ audio clip
161
+ file generic_file
162
+ ```
163
+
164
+ ### Geographic Types
165
+ ```xs
166
+ geo_point location
167
+ geo_polygon boundary
168
+ geo_linestring path
169
+ geo_multipoint points
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Input Filters
175
+
176
+ Filters validate and transform input values. Chain with `|`.
177
+
178
+ ### String Filters
179
+ | Filter | Description |
180
+ |--------|-------------|
181
+ | `trim` | Remove leading/trailing whitespace |
182
+ | `lower` | Convert to lowercase |
183
+ | `upper` | Convert to uppercase |
184
+ | `min:<n>` | Minimum length |
185
+ | `max:<n>` | Maximum length |
186
+ | `ok:<chars>` | Allow only specified characters |
187
+ | `prevent:<str>` | Block specific substrings |
188
+ | `startsWith:<prefix>` | Require prefix |
189
+ | `alphaOk` | Allow only letters |
190
+ | `digitOk` | Allow only digits |
191
+
192
+ ### Numeric Filters
193
+ | Filter | Description |
194
+ |--------|-------------|
195
+ | `min:<n>` | Minimum value |
196
+ | `max:<n>` | Maximum value |
197
+
198
+ ### Examples
199
+ ```xs
200
+ input {
201
+ text username filters=trim|lower|min:3|max:20|alphaOk
202
+ email contact filters=trim|lower
203
+ int age filters=min:0|max:150
204
+ text hex_code filters=ok:abcdef0123456789
205
+ text[] tags filters=trim|lower|max:50
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Nullable vs Optional
212
+
213
+ ```xs
214
+ input {
215
+ # Required, cannot be null
216
+ text required_field
217
+
218
+ # Required, can be null (must provide, can send null)
219
+ text? nullable_field
220
+
221
+ # Optional, cannot be null (can omit, but if sent must have value)
222
+ text optional_field?
223
+
224
+ # Optional, can be null (can omit or send null)
225
+ text? nullable_optional?
226
+
227
+ # Optional with default
228
+ text with_default?="hello"
229
+ }
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Foreign Key References
235
+
236
+ Link input to a table for validation:
237
+
238
+ ```xs
239
+ input {
240
+ int user_id {
241
+ table = "user"
242
+ description = "References user table"
243
+ }
244
+ uuid post_id {
245
+ table = "post"
246
+ }
247
+ }
248
+ ```
249
+
250
+ ---
251
+
252
+ ## Sensitive Fields
253
+
254
+ Mark fields for log masking:
255
+
256
+ ```xs
257
+ input {
258
+ password api_key {
259
+ sensitive = true
260
+ }
261
+ text ssn {
262
+ sensitive = true
263
+ }
264
+ }
265
+ ```
266
+
267
+ ---
268
+
269
+ ## Validation with Preconditions
270
+
271
+ For complex validation beyond filters:
272
+
273
+ ```xs
274
+ stack {
275
+ precondition ($input.start_date < $input.end_date) {
276
+ error_type = "inputerror"
277
+ error = "Start date must be before end date"
278
+ }
279
+
280
+ precondition ($input.password == $input.confirm_password) {
281
+ error_type = "inputerror"
282
+ error = "Passwords must match"
283
+ }
284
+ }
285
+ ```
286
+
287
+ ---
288
+
289
+ ## Best Practices
290
+
291
+ 1. **Always specify types** - Never leave inputs untyped
292
+ 2. **Use filters first** - Prefer declarative filters over stack validation
293
+ 3. **Add descriptions** - Document every field's purpose
294
+ 4. **Mark sensitive data** - Use `sensitive = true` for PII/credentials
295
+ 5. **Use defaults sparingly** - Make requirements explicit
296
+ 6. **Validate at boundaries** - Validate user input, trust internal calls
297
+ 7. **Limit nesting depth** - Keep object schemas 2-3 levels max
@@ -1,3 +1,4 @@
1
1
  {
2
- "version": "0.4.5"
2
+ "version": "2.0.0",
3
+ "updated": "2025-02-06"
3
4
  }