@xano/developer-mcp 2.3.0-beta.0 → 2.3.0-beta.10
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 +2 -1
- package/dist/cli_docs/topics/workspace.js +22 -4
- package/dist/meta_api_docs/topics/api.js +6 -6
- package/dist/meta_api_docs/topics/apigroup.js +2 -2
- package/dist/meta_api_docs/topics/authentication.js +1 -1
- package/dist/meta_api_docs/topics/history.js +42 -11
- package/dist/meta_api_docs/topics/mcp_server.js +6 -6
- package/dist/meta_api_docs/topics/middleware.js +1 -1
- package/dist/meta_api_docs/topics/table.js +2 -2
- package/dist/meta_api_docs/topics/workflows.js +1 -1
- package/dist/meta_api_docs/topics/workspace.js +1 -1
- package/dist/tools/validate_xanoscript.js +14 -5
- package/dist/xanoscript.d.ts +5 -0
- package/dist/xanoscript.js +3 -0
- package/dist/xanoscript_docs/README.md +25 -7
- package/dist/xanoscript_docs/agents.md +14 -5
- package/dist/xanoscript_docs/ai.md +820 -0
- package/dist/xanoscript_docs/branch.md +109 -29
- package/dist/xanoscript_docs/database.md +33 -1
- package/dist/xanoscript_docs/docs_index.json +36 -14
- package/dist/xanoscript_docs/essentials.md +53 -19
- package/dist/xanoscript_docs/file-uploads.md +4 -4
- package/dist/xanoscript_docs/mcp-servers.md +2 -2
- package/dist/xanoscript_docs/prompts.md +4 -2
- package/dist/xanoscript_docs/realtime-v2.md +4 -2
- package/dist/xanoscript_docs/resources.md +3 -1
- package/dist/xanoscript_docs/survival.md +1 -1
- package/dist/xanoscript_docs/tables.md +58 -0
- package/dist/xanoscript_docs/tools.md +1 -1
- package/dist/xanoscript_docs/triggers.md +133 -3
- package/dist/xanoscript_docs/types.md +14 -1
- package/dist/xanoscript_docs/unit-testing.md +29 -2
- package/dist/xanoscript_docs/version.json +2 -2
- package/dist/xanoscript_docs/workflow-tests.md +18 -0
- package/dist/xanoscript_docs/working.md +39 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -669,7 +669,7 @@ xano-developer-mcp/
|
|
|
669
669
|
| Package | Version | Purpose |
|
|
670
670
|
|---------|---------|---------|
|
|
671
671
|
| `@modelcontextprotocol/sdk` | ^1.26.0 | Official MCP SDK |
|
|
672
|
-
| `@xano/xanoscript-language-server` | ^
|
|
672
|
+
| `@xano/xanoscript-language-server` | ^12.18.0 | XanoScript parser and validation |
|
|
673
673
|
| `minimatch` | ^10.1.2 | Glob pattern matching for context-aware docs |
|
|
674
674
|
|
|
675
675
|
### Dev Dependencies
|
|
@@ -729,6 +729,7 @@ Compiles TypeScript to JavaScript in the `dist/` directory.
|
|
|
729
729
|
- **description**: Human-readable description of the topic
|
|
730
730
|
- **aliases**: Alternative names for topic lookup
|
|
731
731
|
- **priority**: Ordering weight for file_path matching
|
|
732
|
+
- **exclusive**: The topic alone documents the files its `applyTo` matches, so file_path mode returns only that topic
|
|
732
733
|
|
|
733
734
|
**Meta API Documentation** (`src/meta_api_docs/`):
|
|
734
735
|
- TypeScript modules with structured documentation
|
|
@@ -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 #
|
|
77
|
+
│ │ └── my_channel.xs # Legacy V1 realtime channels
|
|
62
78
|
│ └── trigger/
|
|
63
|
-
│ └── on_connect.xs #
|
|
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/
|
|
@@ -239,7 +255,7 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
239
255
|
},
|
|
240
256
|
{
|
|
241
257
|
name: "workspace push",
|
|
242
|
-
description: "Upload local XanoScript files to a workspace, including knowledge/skills markdown under knowledge/ (synced automatically, shown in the preview). Default mode is partial (only changed files). Use --sync for a full push. The source directory is the -d/--directory flag (default: current directory), not a positional argument. A partial push is additive, not declarative: it adds and updates but makes no destructive changes (it won't drop a removed column or relax a constraint), so local files and the live workspace can diverge. Use --sync for destructive changes; --dry-run to preview.",
|
|
258
|
+
description: "Upload local XanoScript files to a workspace, including knowledge/skills markdown under knowledge/ (synced automatically, shown in the preview). Default mode is partial (only changed files). Use --sync for a full push. The source directory is the -d/--directory flag (default: current directory), not a positional argument. A partial push is additive, not declarative: it adds and updates but makes no destructive changes (it won't drop a removed column or relax a constraint), so local files and the live workspace can diverge. Use --sync for destructive changes; --dry-run to preview. If the knowledge sync fails after the import has landed, the import stands: the push exits 1, and -o json prints the import document with the failure as error ({exit, message}).",
|
|
243
259
|
usage: "xano workspace push [options]",
|
|
244
260
|
flags: [
|
|
245
261
|
{ name: "directory", short: "d", type: "string", required: false, default: ".", description: "Directory containing documents to push (defaults to current directory)" },
|
|
@@ -256,6 +272,7 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
256
272
|
{ name: "guids", type: "boolean", required: false, default: "true", description: "Write server-assigned GUIDs back to local files after push (--no-guids to disable)" },
|
|
257
273
|
{ name: "include", short: "i", type: "string", required: false, description: "Glob pattern to include files, matched against relative paths (repeatable)" },
|
|
258
274
|
{ name: "exclude", short: "e", type: "string", required: false, description: "Glob pattern to exclude files, matched against relative paths (repeatable)" },
|
|
275
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "summary or json; JSON retains the complete import response" },
|
|
259
276
|
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
|
|
260
277
|
],
|
|
261
278
|
examples: [
|
|
@@ -266,7 +283,8 @@ For lighter-weight iterative development without pulling the whole workspace, se
|
|
|
266
283
|
"xano workspace push --sync --delete --force",
|
|
267
284
|
'xano workspace push -i "api/**" -i "function/**"',
|
|
268
285
|
'xano workspace push -e "table/**" --records --truncate',
|
|
269
|
-
"xano workspace push --no-transaction --no-guids"
|
|
286
|
+
"xano workspace push --no-transaction --no-guids",
|
|
287
|
+
"xano workspace push --force -o json"
|
|
270
288
|
]
|
|
271
289
|
},
|
|
272
290
|
{
|
|
@@ -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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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
|
|
@@ -20,13 +22,13 @@ export const historyDoc = {
|
|
|
20
22
|
ai_hints: `- Use request history to debug API issues
|
|
21
23
|
- Filter by status to find errors (4xx, 5xx)
|
|
22
24
|
- Use branch filter to separate dev/prod logs
|
|
23
|
-
-
|
|
25
|
+
- Pass include_output=true for each request's output; the input is always returned
|
|
24
26
|
- History is limited to recent requests (not permanent storage)`,
|
|
25
27
|
endpoints: [
|
|
26
28
|
{
|
|
27
29
|
method: "GET",
|
|
28
30
|
path: "/workspace/{workspace_id}/request_history",
|
|
29
|
-
tool_name: "
|
|
31
|
+
tool_name: "getApiRequestHistory",
|
|
30
32
|
description: "Get API request history with pagination.",
|
|
31
33
|
parameters: [
|
|
32
34
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
@@ -34,13 +36,13 @@ export const historyDoc = {
|
|
|
34
36
|
{ name: "per_page", type: "integer", default: 50, description: "Items per page (max 500)" },
|
|
35
37
|
{ name: "branch", type: "string", description: "Filter by branch name" },
|
|
36
38
|
{ name: "api_id", type: "integer", description: "Filter by API endpoint ID" },
|
|
37
|
-
{ name: "
|
|
39
|
+
{ name: "include_output", type: "boolean", default: false, description: "Include each request's output (response); the input is always returned" }
|
|
38
40
|
]
|
|
39
41
|
},
|
|
40
42
|
{
|
|
41
43
|
method: "POST",
|
|
42
44
|
path: "/workspace/{workspace_id}/request_history/search",
|
|
43
|
-
tool_name: "
|
|
45
|
+
tool_name: "searchApiRequestHistory",
|
|
44
46
|
description: "Search request history with advanced filters.",
|
|
45
47
|
parameters: [
|
|
46
48
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
|
|
@@ -53,14 +55,15 @@ export const historyDoc = {
|
|
|
53
55
|
status: { type: "array", description: "Filter by status codes (e.g., [200, 201])" },
|
|
54
56
|
verb: { type: "array", description: "Filter by HTTP methods (e.g., ['GET', 'POST'])" },
|
|
55
57
|
from_date: { type: "string", description: "Start date (ISO format)" },
|
|
56
|
-
to_date: { type: "string", description: "End date (ISO format)" }
|
|
58
|
+
to_date: { type: "string", description: "End date (ISO format)" },
|
|
59
|
+
include_output: { type: "boolean", description: "Include each request's output (response); the input is always returned" }
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
},
|
|
60
63
|
{
|
|
61
64
|
method: "GET",
|
|
62
65
|
path: "/workspace/{workspace_id}/function_history",
|
|
63
|
-
tool_name: "
|
|
66
|
+
tool_name: "getFunctionRequestHistory",
|
|
64
67
|
description: "Get function execution history.",
|
|
65
68
|
parameters: [
|
|
66
69
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
@@ -72,7 +75,7 @@ export const historyDoc = {
|
|
|
72
75
|
{
|
|
73
76
|
method: "GET",
|
|
74
77
|
path: "/workspace/{workspace_id}/task_history",
|
|
75
|
-
tool_name: "
|
|
78
|
+
tool_name: "getTaskRequestHistory",
|
|
76
79
|
description: "Get scheduled task execution history.",
|
|
77
80
|
parameters: [
|
|
78
81
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
@@ -84,7 +87,7 @@ export const historyDoc = {
|
|
|
84
87
|
{
|
|
85
88
|
method: "GET",
|
|
86
89
|
path: "/workspace/{workspace_id}/middleware_history",
|
|
87
|
-
tool_name: "
|
|
90
|
+
tool_name: "getMiddlewareRequestHistory",
|
|
88
91
|
description: "Get middleware execution history.",
|
|
89
92
|
parameters: [
|
|
90
93
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
@@ -96,7 +99,7 @@ export const historyDoc = {
|
|
|
96
99
|
{
|
|
97
100
|
method: "GET",
|
|
98
101
|
path: "/workspace/{workspace_id}/tool_history",
|
|
99
|
-
tool_name: "
|
|
102
|
+
tool_name: "getToolRequestHistory",
|
|
100
103
|
description: "Get agent tool execution history.",
|
|
101
104
|
parameters: [
|
|
102
105
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
@@ -105,10 +108,38 @@ export const historyDoc = {
|
|
|
105
108
|
{ name: "per_page", type: "integer", default: 50, description: "Items per page" }
|
|
106
109
|
]
|
|
107
110
|
},
|
|
111
|
+
{
|
|
112
|
+
method: "GET",
|
|
113
|
+
path: "/workspace/{workspace_id}/prompt_history",
|
|
114
|
+
tool_name: "getPromptRequestHistory",
|
|
115
|
+
description: "Get MCP prompt request history, newest first.",
|
|
116
|
+
parameters: [
|
|
117
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
118
|
+
{ name: "prompt_id", type: "integer", description: "Filter by MCP prompt ID" },
|
|
119
|
+
{ name: "branch", type: "string", description: "Filter by branch name" },
|
|
120
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
121
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page (max 500)" },
|
|
122
|
+
{ name: "include_output", type: "boolean", default: false, description: "Include each request's output" }
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
method: "GET",
|
|
127
|
+
path: "/workspace/{workspace_id}/resource_history",
|
|
128
|
+
tool_name: "getResourceRequestHistory",
|
|
129
|
+
description: "Get MCP resource request history, newest first.",
|
|
130
|
+
parameters: [
|
|
131
|
+
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
132
|
+
{ name: "resource_id", type: "integer", description: "Filter by MCP resource ID" },
|
|
133
|
+
{ name: "branch", type: "string", description: "Filter by branch name" },
|
|
134
|
+
{ name: "page", type: "integer", default: 1, description: "Page number" },
|
|
135
|
+
{ name: "per_page", type: "integer", default: 50, description: "Items per page (max 500)" },
|
|
136
|
+
{ name: "include_output", type: "boolean", default: false, description: "Include each request's output" }
|
|
137
|
+
]
|
|
138
|
+
},
|
|
108
139
|
{
|
|
109
140
|
method: "GET",
|
|
110
141
|
path: "/workspace/{workspace_id}/trigger_history",
|
|
111
|
-
tool_name: "
|
|
142
|
+
tool_name: "getTriggerRequestHistory",
|
|
112
143
|
description: "Get trigger execution history.",
|
|
113
144
|
parameters: [
|
|
114
145
|
{ name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
|
|
@@ -145,5 +176,5 @@ export const historyDoc = {
|
|
|
145
176
|
}
|
|
146
177
|
}
|
|
147
178
|
},
|
|
148
|
-
related_topics: ["api", "function", "task"]
|
|
179
|
+
related_topics: ["api", "function", "task", "prompt", "resource"]
|
|
149
180
|
};
|
|
@@ -28,7 +28,7 @@ export const mcpServerDoc = {
|
|
|
28
28
|
{
|
|
29
29
|
method: "GET",
|
|
30
30
|
path: "/workspace/{workspace_id}/mcp_server",
|
|
31
|
-
tool_name: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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" }
|
|
@@ -122,7 +122,7 @@ POST /workspace/1/agent
|
|
|
122
122
|
steps: [
|
|
123
123
|
"1. `POST /workspace/{id}/request_history/search` - Search for failed requests",
|
|
124
124
|
"2. Filter by status: [400, 401, 403, 404, 500]",
|
|
125
|
-
"3. Use
|
|
125
|
+
"3. Use include_output=true to see each request's output (the input is always returned)",
|
|
126
126
|
"4. `GET /workspace/{id}/apigroup/{id}/api/{id}?include_xanoscript=true` - Review endpoint code"
|
|
127
127
|
]
|
|
128
128
|
}
|
|
@@ -126,7 +126,7 @@ export const workspaceDoc = {
|
|
|
126
126
|
{
|
|
127
127
|
method: "GET",
|
|
128
128
|
path: "/workspace/{workspace_id}/openapi",
|
|
129
|
-
tool_name: "
|
|
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" }
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { xanoscriptParser } from "@xano/xanoscript-language-server/parser/parser.js";
|
|
14
14
|
import { getSchemeFromContent } from "@xano/xanoscript-language-server/utils.js";
|
|
15
|
+
import { setPolicyCatalogue } from "@xano/xanoscript-language-server/parser/policy/catalogue.js";
|
|
16
|
+
import policyCatalogueSnapshot from "@xano/xanoscript-language-server/parser/policy/catalogueSnapshot.js";
|
|
15
17
|
import { readFileSync, existsSync, readdirSync } from "fs";
|
|
16
18
|
import { join, resolve, basename } from "path";
|
|
17
19
|
import { minimatch } from "minimatch";
|
|
@@ -21,6 +23,13 @@ export const SEVERITY = {
|
|
|
21
23
|
ERROR: 1,
|
|
22
24
|
WARNING: 2,
|
|
23
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Check policy rules against the check catalogue the language server ships with, as its
|
|
28
|
+
* own server does. Without a catalogue it checks a policy's block shape only. A problem
|
|
29
|
+
* the catalogue decides (an unknown check, field or param, a value outside its set) is
|
|
30
|
+
* a warning, since the instance a file is pushed to may have a newer catalogue.
|
|
31
|
+
*/
|
|
32
|
+
setPolicyCatalogue(policyCatalogueSnapshot, { source: "snapshot" });
|
|
24
33
|
// =============================================================================
|
|
25
34
|
// Error Message Improvements
|
|
26
35
|
// =============================================================================
|
|
@@ -103,12 +112,13 @@ const SYNTAX_SUGGESTIONS = [
|
|
|
103
112
|
/**
|
|
104
113
|
* Enhance error message with helpful suggestions
|
|
105
114
|
*/
|
|
106
|
-
function enhanceErrorMessage(message, code, lineNumber) {
|
|
115
|
+
function enhanceErrorMessage(message, code, lineNumber, scheme) {
|
|
107
116
|
let enhanced = message;
|
|
108
117
|
const lines = code.split("\n");
|
|
109
118
|
const errorLine = lines[lineNumber] || "";
|
|
110
|
-
// Check for type aliases
|
|
111
|
-
|
|
119
|
+
// Check for type aliases, never in a policy: it declares no types, and a value such as
|
|
120
|
+
// object.naming's name_kind: "object" is not one.
|
|
121
|
+
for (const [alias, correct] of scheme === "policy" ? [] : Object.entries(TYPE_ALIASES)) {
|
|
112
122
|
const regex = new RegExp(`\\b${alias}\\b`, "i");
|
|
113
123
|
if (regex.test(errorLine)) {
|
|
114
124
|
enhanced += `\n\n💡 Suggestion: Use "${correct}" instead of "${alias}"`;
|
|
@@ -204,7 +214,7 @@ function validateCode(code, filePath) {
|
|
|
204
214
|
const endLines = text.substring(0, endOffset + 1).split("\n");
|
|
205
215
|
const endLine = endLines.length - 1;
|
|
206
216
|
const endCharacter = endLines[endLines.length - 1].length;
|
|
207
|
-
const enhancedMessage = enhanceErrorMessage(item.message, text, line);
|
|
217
|
+
const enhancedMessage = enhanceErrorMessage(item.message, text, line, scheme);
|
|
208
218
|
return {
|
|
209
219
|
severity,
|
|
210
220
|
range: {
|
|
@@ -379,7 +389,6 @@ export function validateXanoscript(args) {
|
|
|
379
389
|
invalidCount++;
|
|
380
390
|
}
|
|
381
391
|
}
|
|
382
|
-
// Build summary message
|
|
383
392
|
const allValid = invalidCount === 0;
|
|
384
393
|
const summaryLines = [
|
|
385
394
|
`Validated ${filesToValidate.length} file(s): ${validCount} valid, ${invalidCount} invalid`,
|
package/dist/xanoscript.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export interface DocConfig {
|
|
|
14
14
|
* docs_index.json declaration order. Omitted (undefined) sorts last (99).
|
|
15
15
|
*/
|
|
16
16
|
priority?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The topic alone documents the files its `applyTo` matches: file_path mode
|
|
19
|
+
* returns it without `syntax` or any other matching topic.
|
|
20
|
+
*/
|
|
21
|
+
exclusive?: boolean;
|
|
17
22
|
}
|
|
18
23
|
export interface XanoscriptDocsArgs {
|
|
19
24
|
topic?: string;
|
package/dist/xanoscript.js
CHANGED
|
@@ -19,6 +19,7 @@ function buildDocsConfig() {
|
|
|
19
19
|
applyTo: topic.applyTo,
|
|
20
20
|
description: topic.description,
|
|
21
21
|
priority: topic.priority,
|
|
22
|
+
exclusive: topic.exclusive === true,
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
return config;
|
|
@@ -122,6 +123,8 @@ export function getDocsForFilePath(filePath) {
|
|
|
122
123
|
continue; // Don't auto-include readme
|
|
123
124
|
for (const pattern of config.applyTo) {
|
|
124
125
|
if (minimatch(filePath, pattern)) {
|
|
126
|
+
if (config.exclusive)
|
|
127
|
+
return [topic];
|
|
125
128
|
matches.push(topic);
|
|
126
129
|
break;
|
|
127
130
|
}
|
|
@@ -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` | `
|
|
24
|
-
| `resource` | `
|
|
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
|
-
| `
|
|
28
|
-
| `
|
|
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 #
|
|
100
|
+
│ │ └── chat_room.xs # Legacy V1 realtime channels
|
|
84
101
|
│ └── trigger/
|
|
85
|
-
│ └── on_message.xs #
|
|
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
|
```
|
|
@@ -252,6 +269,7 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
|
|
|
252
269
|
|
|
253
270
|
| Topic | Description | Key Sections |
|
|
254
271
|
| ------------- | --------------------------------------------------- | ------------ |
|
|
272
|
+
| `ai` | Xano AI statements: text, image, video, speech, music, transcription, embeddings, rerank | Choosing a Statement, Billing, Models |
|
|
255
273
|
| `agents` | AI agent configuration with LLM providers and tools | LLM Config, Tool Binding |
|
|
256
274
|
| `tools` | AI tools for agents and MCP servers | Tool Schema, Parameters |
|
|
257
275
|
| `mcp-servers` | MCP server definitions exposing tools | Server Config, Tool Exposure |
|
|
@@ -268,7 +286,7 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
|
|
|
268
286
|
| ------------ | ---------------------------------------------------------------------- | ------------ |
|
|
269
287
|
| `workspace` | Workspace-level settings: environment variables, preferences, realtime | Env Variables, Preferences |
|
|
270
288
|
| `branch` | Branch-level settings: middleware, history retention, visual styling | Middleware Config, History |
|
|
271
|
-
| `middleware` | Request/response interceptors for functions, queries, tasks, and
|
|
289
|
+
| `middleware` | Request/response interceptors for functions, queries, tasks, tools, realtime messages, and MCP prompts and resources | Pre/Post Hooks |
|
|
272
290
|
|
|
273
291
|
### Development
|
|
274
292
|
|
|
@@ -6,7 +6,7 @@ applyTo: "ai/agent/*.xs"
|
|
|
6
6
|
|
|
7
7
|
AI-powered agents that use LLMs to perform tasks autonomously.
|
|
8
8
|
|
|
9
|
-
> **TL;DR:** Define with `agent "name" { llm = { type: "provider", system_prompt: "...", prompt: "..." } tools = [...] }`. Providers: `xano-
|
|
9
|
+
> **TL;DR:** Define with `agent "name" { llm = { type: "provider", system_prompt: "...", prompt: "..." } tools = [...] }`. Providers: `xano-ai`, `openai`, `anthropic`, `google-genai` (`xano-free` is deprecated). Tools give agents capabilities.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -29,7 +29,8 @@ agent "<name>" {
|
|
|
29
29
|
### LLM Providers
|
|
30
30
|
| Provider | Type Value |
|
|
31
31
|
|----------|------------|
|
|
32
|
-
| Xano
|
|
32
|
+
| Xano AI (charged in credits) | `xano-ai` |
|
|
33
|
+
| Xano Free (deprecated, runs as Xano AI) | `xano-free` |
|
|
33
34
|
| Google Gemini | `google-genai` |
|
|
34
35
|
| OpenAI | `openai` |
|
|
35
36
|
| Anthropic | `anthropic` |
|
|
@@ -43,7 +44,7 @@ agent "Customer Support" {
|
|
|
43
44
|
canonical = "support-agent-v1"
|
|
44
45
|
description = "Handles customer inquiries"
|
|
45
46
|
llm = {
|
|
46
|
-
type: "xano-
|
|
47
|
+
type: "xano-ai"
|
|
47
48
|
system_prompt: "You are a helpful customer support agent."
|
|
48
49
|
prompt: "{{ $args.user_message }}"
|
|
49
50
|
max_steps: 5
|
|
@@ -60,6 +61,8 @@ agent "Customer Support" {
|
|
|
60
61
|
|
|
61
62
|
## Calling Agents
|
|
62
63
|
|
|
64
|
+
> **One-shot call?** A single prompt-to-answer (summarize, classify, extract JSON, generate an image, embed text) does not need an agent: use `ai.text.generate` and the other Xano AI statements (`xano_xanoscript_docs({ topic: "ai" })`). Use `ai.agent.run` when the model needs tools or multiple steps.
|
|
65
|
+
|
|
63
66
|
```xs
|
|
64
67
|
ai.agent.run "Customer Support" {
|
|
65
68
|
args = {}|set:"user_message":$input.message
|
|
@@ -90,18 +93,23 @@ llm = {
|
|
|
90
93
|
|
|
91
94
|
## Provider Configurations
|
|
92
95
|
|
|
93
|
-
### Xano
|
|
96
|
+
### Xano AI
|
|
97
|
+
Runs on Xano's own models and is charged in AI credits, so it needs no API key. It uses Xano AI's default model; there is no `model` field.
|
|
94
98
|
```xs
|
|
95
99
|
llm = {
|
|
96
|
-
type: "xano-
|
|
100
|
+
type: "xano-ai"
|
|
97
101
|
system_prompt: "You are a helpful assistant."
|
|
98
102
|
prompt: "{{ $args.message }}"
|
|
99
103
|
max_steps: 3
|
|
100
104
|
temperature: 0
|
|
101
105
|
search_grounding: false // Google Search grounding
|
|
106
|
+
location: "eu" // Optional: "us", "global" or "eu"; omit for the workspace default
|
|
102
107
|
}
|
|
103
108
|
```
|
|
104
109
|
|
|
110
|
+
### Xano Free (deprecated)
|
|
111
|
+
`type: "xano-free"` is still valid, so existing agents keep working, but the validator marks it deprecated. Where Xano AI is available, a `xano-free` agent runs as Xano AI: charged in credits, on Xano AI's default model and the workspace's location. Write new agents with `type: "xano-ai"`.
|
|
112
|
+
|
|
105
113
|
### Google Gemini
|
|
106
114
|
```xs
|
|
107
115
|
llm = {
|
|
@@ -387,6 +395,7 @@ agent "Research Agent" {
|
|
|
387
395
|
|
|
388
396
|
| Topic | Description |
|
|
389
397
|
|-------|-------------|
|
|
398
|
+
| `ai` | One-shot Xano AI statements (`ai.text.generate`, `ai.image.generate`, ...) |
|
|
390
399
|
| `tools` | Functions that agents can execute |
|
|
391
400
|
| `mcp-servers` | MCP server configuration |
|
|
392
401
|
| `triggers` | Agent triggers for events |
|