@xano/developer-mcp 2.0.3 → 2.0.5
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.
|
@@ -30,6 +30,8 @@ XanoScript is the declarative scripting language for [Xano](https://xano.com), a
|
|
|
30
30
|
|
|
31
31
|
**Important:** Each `.xs` file must contain exactly one definition. You cannot define multiple tables, functions, queries, or other constructs in a single file.
|
|
32
32
|
|
|
33
|
+
**The `guid` field (backend-managed — ignore it):** Any construct may carry a top-level `guid = "..."` — a stable identifier Xano assigns and maintains automatically. **Leave it exactly as-is when editing, omit it when writing new code (the backend adds one on save), and never add, change, or remove one unless explicitly asked.**
|
|
34
|
+
|
|
33
35
|
## Workspace Structure
|
|
34
36
|
|
|
35
37
|
After pulling from Xano, files are organized using `snake_case` naming:
|
|
@@ -44,11 +46,11 @@ project/
|
|
|
44
46
|
├── api/
|
|
45
47
|
│ └── users/ # API group folder
|
|
46
48
|
│ ├── api_group.xs # API group definition
|
|
47
|
-
│ ├── get_all_get.xs # GET /users
|
|
48
|
-
│ ├── get_one_get.xs # GET /users
|
|
49
|
-
│ ├── create_post.xs # POST /users
|
|
49
|
+
│ ├── get_all_get.xs # GET /api:users/get_all
|
|
50
|
+
│ ├── get_one_get.xs # GET /api:users/get_one/{id} (query name "get_one/{id}" — static prefix avoids collisions with other path-param queries in the group)
|
|
51
|
+
│ ├── create_post.xs # POST /api:users/create
|
|
50
52
|
│ └── nested/
|
|
51
|
-
│ └── profile_get.xs # Nested endpoint: GET /users/nested/profile
|
|
53
|
+
│ └── profile_get.xs # Nested endpoint: GET /api:users/nested/profile
|
|
52
54
|
├── function/
|
|
53
55
|
│ └── validate_token.xs # Reusable functions
|
|
54
56
|
├── task/
|
|
@@ -47,17 +47,31 @@ query "endpoint-path" verb=<METHOD> {
|
|
|
47
47
|
|
|
48
48
|
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.
|
|
49
49
|
|
|
50
|
-
**Full URL
|
|
50
|
+
**Full public URL:**
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
|
|
53
|
+
<api_baseurl>/api:<canonical>[:<branch>]/<query_name>
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
Where:
|
|
57
|
+
- `<api_baseurl>` — instance base URL (value of `$env.$api_baseurl` at runtime)
|
|
58
|
+
- `<canonical>` — the `canonical` property of the API group
|
|
59
|
+
- `<branch>` — **optional** branch name (value of `$env.$branch` at runtime). Omit the entire `:<branch>` segment (including the colon) to target the live branch.
|
|
60
|
+
- `<query_name>` — the query's `name` (may contain slashes for nested paths)
|
|
61
|
+
|
|
62
|
+
Example: `https://example.xano.io/api:blog-api:v2/categories`
|
|
63
|
+
- `<api_baseurl>` → `https://example.xano.io`
|
|
64
|
+
- `<canonical>` → `blog-api`
|
|
65
|
+
- `<branch>` → `v2`
|
|
66
|
+
- `<query_name>` → `categories`
|
|
67
|
+
|
|
68
|
+
Live-branch example (no branch segment): `https://example.xano.io/api:blog-api/categories`
|
|
69
|
+
|
|
56
70
|
The query name can include slashes for nested paths:
|
|
57
71
|
|
|
58
|
-
- `query "list" verb=GET` →
|
|
59
|
-
- `query "users/{id}" verb=GET` →
|
|
60
|
-
- `query "admin/reports/daily" verb=GET` →
|
|
72
|
+
- `query "list" verb=GET` → `/api:<canonical>/list`
|
|
73
|
+
- `query "users/{id}" verb=GET` → `/api:<canonical>/users/{id}`
|
|
74
|
+
- `query "admin/reports/daily" verb=GET` → `/api:<canonical>/admin/reports/daily`
|
|
61
75
|
|
|
62
76
|
### HTTP Methods
|
|
63
77
|
|
|
@@ -104,16 +118,16 @@ api_group Authentication {
|
|
|
104
118
|
api/
|
|
105
119
|
├── users/
|
|
106
120
|
│ ├── api_group.xs # Defines group (canonical = "myapp-users")
|
|
107
|
-
│ ├── list_get.xs # GET /myapp-users/list
|
|
108
|
-
│ └── by_id_get.xs # GET /myapp-users/{id}
|
|
121
|
+
│ ├── list_get.xs # GET /api:myapp-users/list
|
|
122
|
+
│ └── by_id_get.xs # GET /api:myapp-users/by_id/{id} (query name "by_id/{id}" — static prefix avoids collisions)
|
|
109
123
|
└── products/
|
|
110
124
|
├── api_group.xs # Defines group (canonical = "myapp-products")
|
|
111
|
-
└── search_get.xs # GET /myapp-products/search
|
|
125
|
+
└── search_get.xs # GET /api:myapp-products/search
|
|
112
126
|
```
|
|
113
127
|
|
|
114
128
|
**Naming convention:** Endpoint files use `{name}_{verb}.xs` format (e.g., `list_get.xs`, `create_post.xs`).
|
|
115
129
|
|
|
116
|
-
|
|
130
|
+
Public URL: `<api_baseurl>/api:<canonical>[:<branch>]/<query_name>` (e.g., `https://example.xano.io/api:myapp-users/profile`, or `https://example.xano.io/api:myapp-users:v2/profile` to target branch `v2`). See [Query Name](#query-name-required-non-empty) above for the full placeholder legend.
|
|
117
131
|
|
|
118
132
|
---
|
|
119
133
|
|
|
@@ -29,6 +29,8 @@ For detailed references on specific filter categories, use:
|
|
|
29
29
|
- `xano_xanoscript_docs({ topic: "syntax/array-filters" })` — Array filters, functional operations, array functions
|
|
30
30
|
- `xano_xanoscript_docs({ topic: "syntax/functions" })` — Math filters/functions, object functions, bitwise operations
|
|
31
31
|
|
|
32
|
+
**The `guid` field (backend-managed — ignore it):** Any construct may carry a top-level `guid = "..."` (e.g. `guid = "tgGYuUFKbBz4_6DIkDR5hUUCRno"`) — a stable identifier Xano assigns and maintains automatically. **Leave it exactly as-is when editing, omit it when writing new code (the backend adds one on save), and never add, change, or remove one unless explicitly asked.**
|
|
33
|
+
|
|
32
34
|
## CRITICAL: Filters Are Type-Specific
|
|
33
35
|
|
|
34
36
|
> **Filters only work on the correct input type.** String filters and array filters are NOT interchangeable. Using the wrong filter type will produce errors or incorrect results.
|
|
@@ -456,26 +458,26 @@ Built-in variables available in the execution context.
|
|
|
456
458
|
|
|
457
459
|
### Request Context
|
|
458
460
|
|
|
459
|
-
| Variable | Description |
|
|
460
|
-
|
|
461
|
-
| `$remote_ip` | Client IP address |
|
|
462
|
-
| `$
|
|
463
|
-
| `$
|
|
464
|
-
| `$
|
|
465
|
-
| `$
|
|
466
|
-
| `$
|
|
467
|
-
| `$http_headers` | Request headers object |
|
|
468
|
-
| `$request_auth_token` | Authorization token (if present) |
|
|
461
|
+
| Variable | Type | Description |
|
|
462
|
+
|----------|------|-------------|
|
|
463
|
+
| `$remote_ip` | text | Client IP address |
|
|
464
|
+
| `$request_method` | text | HTTP method (GET, POST, etc.) |
|
|
465
|
+
| `$request_uri` | text | Full request URI |
|
|
466
|
+
| `$request_querystring` | text | Query string portion |
|
|
467
|
+
| `$http_headers` | object | Request headers object |
|
|
468
|
+
| `$request_auth_token` | text | Authorization token (if present) |
|
|
469
469
|
|
|
470
470
|
### System Context
|
|
471
471
|
|
|
472
|
-
| Variable | Description |
|
|
473
|
-
|
|
474
|
-
| `$datasource` | Current data source name |
|
|
475
|
-
| `$branch` | Current branch name |
|
|
476
|
-
| `$tenant` | Tenant ID (multi-tenant apps) |
|
|
477
|
-
| `$api_baseurl` | API base URL |
|
|
478
|
-
| `$
|
|
472
|
+
| Variable | Type | Description |
|
|
473
|
+
|----------|------|-------------|
|
|
474
|
+
| `$datasource` | text | Current data source name |
|
|
475
|
+
| `$branch` | text | Current branch name |
|
|
476
|
+
| `$tenant` | text | Tenant ID (multi-tenant apps) |
|
|
477
|
+
| `$api_baseurl` | text | API base URL |
|
|
478
|
+
| `$release` | int | Current release number |
|
|
479
|
+
| `$platform` | int | Platform identifier |
|
|
480
|
+
| `$debugger` | bool | True when running under the debugger |
|
|
479
481
|
|
|
480
482
|
### Access via $env
|
|
481
483
|
|
|
@@ -487,6 +489,8 @@ var $headers { value = $env.$http_headers }
|
|
|
487
489
|
var $current_branch { value = $env.$branch }
|
|
488
490
|
|
|
489
491
|
// Custom environment variables (set in Xano dashboard)
|
|
492
|
+
// Note: user-defined env var names have no `$` prefix — only built-in
|
|
493
|
+
// system vars use `$`. Access them as `$env.<name>`, not `$env.$<name>`.
|
|
490
494
|
var $api_key { value = $env.MY_API_KEY }
|
|
491
495
|
```
|
|
492
496
|
|
package/package.json
CHANGED