@xano/developer-mcp 1.0.75 → 2.0.0-beta.0
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 +104 -37
- package/dist/cli_docs/index.d.ts +13 -37
- package/dist/cli_docs/index.js +28 -39
- package/dist/cli_docs/topics/integration.js +1 -1
- package/dist/cli_docs/topics/workspace.js +1 -1
- package/dist/index.js +58 -55
- package/dist/lib.d.ts +3 -1
- package/dist/lib.js +1 -1
- package/dist/meta_api_docs/format.js +1 -1
- package/dist/meta_api_docs/index.d.ts +14 -42
- package/dist/meta_api_docs/index.js +34 -46
- package/dist/tools/cli_docs.d.ts +2 -3
- package/dist/tools/cli_docs.js +3 -5
- package/dist/tools/define_tool.d.ts +47 -0
- package/dist/tools/define_tool.js +36 -0
- package/dist/tools/index.d.ts +88 -221
- package/dist/tools/index.js +80 -109
- package/dist/tools/mcp_version.d.ts +4 -25
- package/dist/tools/mcp_version.js +12 -19
- package/dist/tools/meta_api_docs.d.ts +2 -3
- package/dist/tools/meta_api_docs.js +3 -5
- package/dist/tools/validate_xanoscript.d.ts +18 -65
- package/dist/tools/validate_xanoscript.js +56 -54
- package/dist/tools/xanoscript_docs.d.ts +25 -74
- package/dist/tools/xanoscript_docs.js +86 -83
- package/dist/xanoscript_docs/README.md +5 -5
- package/dist/xanoscript_docs/apis.md +2 -2
- package/dist/xanoscript_docs/database.md +1 -1
- package/dist/xanoscript_docs/essentials.md +6 -6
- package/dist/xanoscript_docs/functions.md +3 -3
- package/dist/xanoscript_docs/integrations.md +5 -5
- package/dist/xanoscript_docs/middleware.md +1 -1
- package/dist/xanoscript_docs/performance.md +4 -4
- package/dist/xanoscript_docs/realtime.md +2 -2
- package/dist/xanoscript_docs/security.md +1 -1
- package/dist/xanoscript_docs/survival.md +1 -1
- package/dist/xanoscript_docs/syntax/string-filters.md +1 -1
- package/dist/xanoscript_docs/syntax.md +9 -9
- package/dist/xanoscript_docs/tools.md +2 -2
- package/dist/xanoscript_docs/types.md +2 -2
- package/dist/xanoscript_docs/unit-testing.md +1 -1
- package/dist/xanoscript_docs/workflow-tests.md +1 -1
- package/dist/xanoscript_docs/working.md +4 -4
- package/package.json +5 -4
- package/dist/api_docs/format.d.ts +0 -5
- package/dist/api_docs/format.js +0 -171
- package/dist/api_docs/index.d.ts +0 -52
- package/dist/api_docs/index.js +0 -111
- package/dist/api_docs/topics/agent.d.ts +0 -2
- package/dist/api_docs/topics/agent.js +0 -142
- package/dist/api_docs/topics/api.d.ts +0 -2
- package/dist/api_docs/topics/api.js +0 -176
- package/dist/api_docs/topics/apigroup.d.ts +0 -2
- package/dist/api_docs/topics/apigroup.js +0 -124
- package/dist/api_docs/topics/authentication.d.ts +0 -2
- package/dist/api_docs/topics/authentication.js +0 -61
- package/dist/api_docs/topics/branch.d.ts +0 -2
- package/dist/api_docs/topics/branch.js +0 -73
- package/dist/api_docs/topics/file.d.ts +0 -2
- package/dist/api_docs/topics/file.js +0 -70
- package/dist/api_docs/topics/function.d.ts +0 -2
- package/dist/api_docs/topics/function.js +0 -164
- package/dist/api_docs/topics/history.d.ts +0 -2
- package/dist/api_docs/topics/history.js +0 -149
- package/dist/api_docs/topics/mcp_server.d.ts +0 -2
- package/dist/api_docs/topics/mcp_server.js +0 -139
- package/dist/api_docs/topics/middleware.d.ts +0 -2
- package/dist/api_docs/topics/middleware.js +0 -156
- package/dist/api_docs/topics/realtime.d.ts +0 -2
- package/dist/api_docs/topics/realtime.js +0 -112
- package/dist/api_docs/topics/start.d.ts +0 -2
- package/dist/api_docs/topics/start.js +0 -107
- package/dist/api_docs/topics/table.d.ts +0 -2
- package/dist/api_docs/topics/table.js +0 -195
- package/dist/api_docs/topics/task.d.ts +0 -2
- package/dist/api_docs/topics/task.js +0 -165
- package/dist/api_docs/topics/tool.d.ts +0 -2
- package/dist/api_docs/topics/tool.js +0 -150
- package/dist/api_docs/topics/workflows.d.ts +0 -2
- package/dist/api_docs/topics/workflows.js +0 -131
- package/dist/api_docs/topics/workspace.d.ts +0 -2
- package/dist/api_docs/topics/workspace.js +0 -153
- package/dist/api_docs/types.d.ts +0 -79
- package/dist/api_docs/types.js +0 -4
- package/dist/cli_docs/topics/run.d.ts +0 -2
- package/dist/cli_docs/topics/run.js +0 -248
- package/dist/meta_api_docs/format.test.d.ts +0 -1
- package/dist/meta_api_docs/format.test.js +0 -272
- package/dist/meta_api_docs/index.test.d.ts +0 -1
- package/dist/meta_api_docs/index.test.js +0 -128
- package/dist/meta_api_docs/types.test.d.ts +0 -1
- package/dist/meta_api_docs/types.test.js +0 -132
- package/dist/templates/init-workspace.d.ts +0 -10
- package/dist/templates/init-workspace.js +0 -278
- package/dist/templates/xanoscript-index.d.ts +0 -11
- package/dist/templates/xanoscript-index.js +0 -72
- package/dist/tools/index.test.d.ts +0 -1
- package/dist/tools/index.test.js +0 -179
- package/dist/tools/xanoscript_docs.test.d.ts +0 -1
- package/dist/tools/xanoscript_docs.test.js +0 -197
- package/dist/xanoscript.test.d.ts +0 -1
- package/dist/xanoscript.test.js +0 -421
- package/dist/xanoscript_docs/cheatsheet.md +0 -287
- package/dist/xanoscript_docs/ephemeral.md +0 -330
- package/dist/xanoscript_docs/quickstart.md +0 -692
- package/dist/xanoscript_docs/run.md +0 -196
- package/dist/xanoscript_docs/schema.md +0 -300
- package/dist/xanoscript_docs_auto/README.md +0 -119
- package/dist/xanoscript_docs_auto/agents.md +0 -446
- package/dist/xanoscript_docs_auto/apis.md +0 -517
- package/dist/xanoscript_docs_auto/control-flow.md +0 -543
- package/dist/xanoscript_docs_auto/database.md +0 -551
- package/dist/xanoscript_docs_auto/debugging.md +0 -527
- package/dist/xanoscript_docs_auto/filters.md +0 -464
- package/dist/xanoscript_docs_auto/functions.md +0 -431
- package/dist/xanoscript_docs_auto/integrations.md +0 -657
- package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
- package/dist/xanoscript_docs_auto/operators.md +0 -368
- package/dist/xanoscript_docs_auto/syntax.md +0 -287
- package/dist/xanoscript_docs_auto/tables.md +0 -447
- package/dist/xanoscript_docs_auto/tasks.md +0 -479
- package/dist/xanoscript_docs_auto/testing.md +0 -574
- package/dist/xanoscript_docs_auto/tools.md +0 -485
- package/dist/xanoscript_docs_auto/triggers.md +0 -595
- package/dist/xanoscript_docs_auto/types.md +0 -323
- package/dist/xanoscript_docs_auto/variables.md +0 -462
- package/dist/xanoscript_docs_auto/version.json +0 -5
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Retrieves XanoScript programming language documentation.
|
|
5
5
|
* Can be used standalone or within the MCP server.
|
|
6
6
|
*/
|
|
7
|
+
import { z } from "zod";
|
|
7
8
|
import { type XanoscriptDocsArgs, type TopicDoc } from "../xanoscript.js";
|
|
8
9
|
import type { ToolResult } from "./types.js";
|
|
9
10
|
export type { XanoscriptDocsArgs };
|
|
@@ -50,77 +51,27 @@ export declare function xanoscriptDocs(args?: XanoscriptDocsArgs): XanoscriptDoc
|
|
|
50
51
|
* For file_path mode, returns each topic as a separate content block.
|
|
51
52
|
*/
|
|
52
53
|
export declare function xanoscriptDocsTool(args?: XanoscriptDocsArgs): ToolResult;
|
|
53
|
-
export declare const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
description: string;
|
|
78
|
-
};
|
|
79
|
-
tier: {
|
|
80
|
-
type: string;
|
|
81
|
-
enum: string[];
|
|
82
|
-
description: string;
|
|
83
|
-
};
|
|
84
|
-
max_tokens: {
|
|
85
|
-
type: string;
|
|
86
|
-
description: string;
|
|
87
|
-
};
|
|
88
|
-
exclude_topics: {
|
|
89
|
-
type: string;
|
|
90
|
-
items: {
|
|
91
|
-
type: string;
|
|
92
|
-
};
|
|
93
|
-
description: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
required: never[];
|
|
97
|
-
};
|
|
98
|
-
outputSchema: {
|
|
99
|
-
type: string;
|
|
100
|
-
properties: {
|
|
101
|
-
documentation: {
|
|
102
|
-
type: string;
|
|
103
|
-
description: string;
|
|
104
|
-
};
|
|
105
|
-
file_path: {
|
|
106
|
-
type: string;
|
|
107
|
-
description: string;
|
|
108
|
-
};
|
|
109
|
-
mode: {
|
|
110
|
-
type: string;
|
|
111
|
-
description: string;
|
|
112
|
-
};
|
|
113
|
-
version: {
|
|
114
|
-
type: string;
|
|
115
|
-
description: string;
|
|
116
|
-
};
|
|
117
|
-
topics: {
|
|
118
|
-
type: string;
|
|
119
|
-
items: {
|
|
120
|
-
type: string;
|
|
121
|
-
};
|
|
122
|
-
description: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
};
|
|
54
|
+
export declare const xanoscriptDocsToolSpec: import("./define_tool.js").BuiltTool<{
|
|
55
|
+
topic: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
[x: string]: string;
|
|
57
|
+
}>>;
|
|
58
|
+
file_path: z.ZodOptional<z.ZodString>;
|
|
59
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
index: "index";
|
|
61
|
+
full: "full";
|
|
62
|
+
quick_reference: "quick_reference";
|
|
63
|
+
}>>;
|
|
64
|
+
tier: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
survival: "survival";
|
|
66
|
+
working: "working";
|
|
67
|
+
}>>;
|
|
68
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
exclude_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
}, {
|
|
71
|
+
documentation: z.ZodOptional<z.ZodString>;
|
|
72
|
+
file_path: z.ZodOptional<z.ZodString>;
|
|
73
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
74
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
75
|
+
version: z.ZodOptional<z.ZodString>;
|
|
76
|
+
topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
}>;
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
import { readFileSync } from "fs";
|
|
8
8
|
import { dirname, join } from "path";
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
10
|
+
import { z } from "zod";
|
|
10
11
|
import { readXanoscriptDocsV2, readXanoscriptDocsStructured, getXanoscriptDocsVersion, getTopicNames, getTopicDescriptions, } from "../xanoscript.js";
|
|
12
|
+
import { defineTool } from "./define_tool.js";
|
|
11
13
|
// =============================================================================
|
|
12
14
|
// Path Resolution
|
|
13
15
|
// =============================================================================
|
|
@@ -26,17 +28,27 @@ export function getXanoscriptDocsPath() {
|
|
|
26
28
|
join(__dirname, "..", "..", "src", "xanoscript_docs"), // src/xanoscript_docs (dev)
|
|
27
29
|
join(__dirname, "..", "..", "xanoscript_docs"), // fallback
|
|
28
30
|
];
|
|
31
|
+
const errors = [];
|
|
29
32
|
for (const p of possiblePaths) {
|
|
30
33
|
try {
|
|
31
34
|
readFileSync(join(p, "version.json"));
|
|
32
35
|
_docsPath = p;
|
|
33
36
|
return p;
|
|
34
37
|
}
|
|
35
|
-
catch {
|
|
36
|
-
|
|
38
|
+
catch (error) {
|
|
39
|
+
const code = error?.code ?? "UNKNOWN";
|
|
40
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
41
|
+
errors.push({ path: p, code, message });
|
|
42
|
+
// ENOENT means "not this candidate, try next." Anything else is unusual
|
|
43
|
+
// (EACCES, malformed version.json) and worth surfacing.
|
|
44
|
+
if (code !== "ENOENT") {
|
|
45
|
+
console.error(`[xanoscript_docs] Unexpected error reading ${p}/version.json: ${code} — ${message}`);
|
|
46
|
+
}
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
|
-
|
|
49
|
+
console.error("[xanoscript_docs] Could not locate version.json in any candidate path. " +
|
|
50
|
+
"Falling back to dist/xanoscript_docs. Candidates tried:\n" +
|
|
51
|
+
errors.map((e) => ` - ${e.path} (${e.code})`).join("\n"));
|
|
40
52
|
_docsPath = join(__dirname, "..", "xanoscript_docs");
|
|
41
53
|
return _docsPath;
|
|
42
54
|
}
|
|
@@ -144,8 +156,9 @@ export function xanoscriptDocsTool(args) {
|
|
|
144
156
|
// =============================================================================
|
|
145
157
|
// MCP Tool Definition
|
|
146
158
|
// =============================================================================
|
|
147
|
-
|
|
148
|
-
|
|
159
|
+
const topicEnumValues = getTopicNames();
|
|
160
|
+
export const xanoscriptDocsToolSpec = defineTool({
|
|
161
|
+
name: "xano_xanoscript_docs",
|
|
149
162
|
description: "Get XanoScript programming language documentation for AI code generation. " +
|
|
150
163
|
"Call without parameters for overview (README). " +
|
|
151
164
|
"For context-limited models: use tier='survival' (~800 tokens) or tier='working' (~3500 tokens). " +
|
|
@@ -159,83 +172,73 @@ export const xanoscriptDocsToolDefinition = {
|
|
|
159
172
|
idempotentHint: true,
|
|
160
173
|
openWorldHint: false,
|
|
161
174
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
tier
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
exclude_topics:
|
|
206
|
-
|
|
207
|
-
items: { type: "string" },
|
|
208
|
-
description: "List of topic names to exclude from file_path results. " +
|
|
209
|
-
"Use this to skip topics you've already loaded (e.g., exclude_topics: ['syntax', 'essentials']). " +
|
|
210
|
-
"Only applies when using file_path parameter.",
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
required: [],
|
|
175
|
+
inputShape: {
|
|
176
|
+
topic: z
|
|
177
|
+
.enum(topicEnumValues)
|
|
178
|
+
.optional()
|
|
179
|
+
.describe("Documentation topic to retrieve. Call without any parameters to get the README overview. " +
|
|
180
|
+
"Example: topic='syntax' for language syntax, topic='database' for database operations, topic='types' for type system.\n\n" +
|
|
181
|
+
"Available topics:\n" +
|
|
182
|
+
getTopicDescriptions()),
|
|
183
|
+
file_path: z
|
|
184
|
+
.string()
|
|
185
|
+
.optional()
|
|
186
|
+
.describe("File path being edited. Returns all relevant docs automatically based on the file type and location. " +
|
|
187
|
+
"Uses applyTo pattern matching to select applicable topics. " +
|
|
188
|
+
"Example: 'api/users/create.xs' returns API, database, and syntax docs. " +
|
|
189
|
+
"'function/format.xs' returns function and syntax docs."),
|
|
190
|
+
mode: z
|
|
191
|
+
.enum(["full", "quick_reference", "index"])
|
|
192
|
+
.optional()
|
|
193
|
+
.describe("'full' = complete documentation with explanations and examples. " +
|
|
194
|
+
"'quick_reference' = compact reference with just syntax patterns and signatures. " +
|
|
195
|
+
"'index' = compact topic listing with descriptions and byte sizes (~1KB). " +
|
|
196
|
+
"Use 'index' to discover available topics before loading them. " +
|
|
197
|
+
"Use 'quick_reference' to save context window space when you just need a reminder. " +
|
|
198
|
+
"Default: 'full' for topic mode, 'quick_reference' for file_path mode."),
|
|
199
|
+
tier: z
|
|
200
|
+
.enum(["survival", "working"])
|
|
201
|
+
.optional()
|
|
202
|
+
.describe("Pre-packaged documentation tier for context-limited models. " +
|
|
203
|
+
"'survival' (~3KB, ~800 tokens): minimum syntax to write valid XanoScript. " +
|
|
204
|
+
"'working' (~12KB, ~3500 tokens): complete reference for common tasks. " +
|
|
205
|
+
"Overrides topic/file_path/mode when set. " +
|
|
206
|
+
"Use 'survival' for models with <16K context, 'working' for 16-64K context."),
|
|
207
|
+
max_tokens: z
|
|
208
|
+
.number()
|
|
209
|
+
.optional()
|
|
210
|
+
.describe("Maximum estimated token budget for documentation. " +
|
|
211
|
+
"When used with file_path, loads topics in priority order until budget is reached. " +
|
|
212
|
+
"Helps prevent context overflow for small-window models. " +
|
|
213
|
+
"Estimate: 1KB of docs ≈ 250 tokens."),
|
|
214
|
+
exclude_topics: z
|
|
215
|
+
.array(z.string())
|
|
216
|
+
.optional()
|
|
217
|
+
.describe("List of topic names to exclude from file_path results. " +
|
|
218
|
+
"Use this to skip topics you've already loaded (e.g., exclude_topics: ['syntax', 'essentials']). " +
|
|
219
|
+
"Only applies when using file_path parameter."),
|
|
214
220
|
},
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
description: "List of matched topic names (file_path mode only).",
|
|
238
|
-
},
|
|
239
|
-
},
|
|
221
|
+
outputShape: {
|
|
222
|
+
documentation: z
|
|
223
|
+
.string()
|
|
224
|
+
.optional()
|
|
225
|
+
.describe("The documentation content (topic or README mode)."),
|
|
226
|
+
file_path: z
|
|
227
|
+
.string()
|
|
228
|
+
.optional()
|
|
229
|
+
.describe("The file path that was matched (file_path mode only)."),
|
|
230
|
+
mode: z.string().optional().describe("The documentation mode used."),
|
|
231
|
+
tier: z
|
|
232
|
+
.string()
|
|
233
|
+
.optional()
|
|
234
|
+
.describe("The pre-packaged tier used, if any."),
|
|
235
|
+
version: z
|
|
236
|
+
.string()
|
|
237
|
+
.optional()
|
|
238
|
+
.describe("The XanoScript documentation version."),
|
|
239
|
+
topics: z
|
|
240
|
+
.array(z.string())
|
|
241
|
+
.optional()
|
|
242
|
+
.describe("List of matched topic names (file_path mode only)."),
|
|
240
243
|
},
|
|
241
|
-
};
|
|
244
|
+
});
|
|
@@ -93,7 +93,7 @@ project/
|
|
|
93
93
|
|
|
94
94
|
Access with `$env.<name>`. Common built-in variables include `$env.$remote_ip`, `$env.$http_headers`, `$env.$request_method`, `$env.$datasource`, and `$env.$branch`. Custom environment variables are set in the Xano dashboard and accessed as `$env.MY_VAR`.
|
|
95
95
|
|
|
96
|
-
For the complete list of system variables, see `
|
|
96
|
+
For the complete list of system variables, see `xano_xanoscript_docs({ topic: "syntax" })`.
|
|
97
97
|
|
|
98
98
|
## Core Syntax Patterns
|
|
99
99
|
|
|
@@ -118,7 +118,7 @@ $db.table.field // Database field reference (in queries)
|
|
|
118
118
|
$this // Current item in loops/maps
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
**Reserved Variables:** The following cannot be used as variable names: `$response`, `$output`, `$input`, `$auth`, `$env`, `$db`, `$this`, `$result`, `$index`. See `
|
|
121
|
+
**Reserved Variables:** The following cannot be used as variable names: `$response`, `$output`, `$input`, `$auth`, `$env`, `$db`, `$this`, `$result`, `$index`. See `xano_xano_xanoscript_docs({ topic: "essentials" })` for detailed variable access rules.
|
|
122
122
|
|
|
123
123
|
### Type Names
|
|
124
124
|
|
|
@@ -183,7 +183,7 @@ This helps AI tools apply the correct documentation based on the file being edit
|
|
|
183
183
|
|
|
184
184
|
For common patterns and quick examples, use:
|
|
185
185
|
```
|
|
186
|
-
|
|
186
|
+
xano_xanoscript_docs({ topic: "essentials" })
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
This includes:
|
|
@@ -197,7 +197,7 @@ This includes:
|
|
|
197
197
|
|
|
198
198
|
## Documentation Index
|
|
199
199
|
|
|
200
|
-
Use `
|
|
200
|
+
Use `xano_xanoscript_docs({ topic: "<topic>" })` to retrieve documentation.
|
|
201
201
|
|
|
202
202
|
### Tiers (for context-limited models)
|
|
203
203
|
|
|
@@ -206,7 +206,7 @@ Use `xanoscript_docs({ topic: "<topic>" })` to retrieve documentation.
|
|
|
206
206
|
| `survival` | Minimal syntax survival kit for models with <16K context | ~3KB (~800 tokens) |
|
|
207
207
|
| `working` | Complete working reference for models with 16-64K context | ~12KB (~3500 tokens) |
|
|
208
208
|
|
|
209
|
-
Use `
|
|
209
|
+
Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier: "working" })`.
|
|
210
210
|
|
|
211
211
|
### Core Language
|
|
212
212
|
|
|
@@ -140,7 +140,7 @@ query "products" verb=GET {
|
|
|
140
140
|
|
|
141
141
|
## Input Block
|
|
142
142
|
|
|
143
|
-
> **Input block rules:** Empty and single-input blocks can be one-liners. Multiple inputs must be on separate lines. For complete type reference, validation filters, and schema definitions, see `
|
|
143
|
+
> **Input block rules:** Empty and single-input blocks can be one-liners. Multiple inputs must be on separate lines. For complete type reference, validation filters, and schema definitions, see `xano_xanoscript_docs({ topic: "types" })`.
|
|
144
144
|
|
|
145
145
|
```xs
|
|
146
146
|
// OK - empty or single input as one-liner
|
|
@@ -430,7 +430,7 @@ stack {
|
|
|
430
430
|
|
|
431
431
|
## Error Handling
|
|
432
432
|
|
|
433
|
-
> **Error types:** Use `inputerror` (400), `accessdenied` (403), `notfound` (404), or `standard` (500). For complete error handling patterns including `precondition`, `try_catch`, and `throw`, see `
|
|
433
|
+
> **Error types:** Use `inputerror` (400), `accessdenied` (403), `notfound` (404), or `standard` (500). For complete error handling patterns including `precondition`, `try_catch`, and `throw`, see `xano_xanoscript_docs({ topic: "syntax" })`.
|
|
434
434
|
|
|
435
435
|
---
|
|
436
436
|
|
|
@@ -52,7 +52,7 @@ var $api_response { value = "test" }
|
|
|
52
52
|
|
|
53
53
|
XanoScript uses specific type names. Common aliases from other languages won't work.
|
|
54
54
|
|
|
55
|
-
> **Type names:** Use `text` (not string), `int` (not integer), `bool` (not boolean), `decimal` (not float). Full list: `
|
|
55
|
+
> **Type names:** Use `text` (not string), `int` (not integer), `bool` (not boolean), `decimal` (not float). Full list: `xano_xanoscript_docs({ topic: "types" })`
|
|
56
56
|
|
|
57
57
|
### Variable Declaration
|
|
58
58
|
|
|
@@ -166,7 +166,7 @@ db.del "user" {
|
|
|
166
166
|
}
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
> **Full reference:** See `
|
|
169
|
+
> **Full reference:** See `xano_xanoscript_docs({ topic: "database" })` for joins, bulk operations, transactions, and more.
|
|
170
170
|
|
|
171
171
|
### API Requests
|
|
172
172
|
|
|
@@ -231,7 +231,7 @@ throw {
|
|
|
231
231
|
|
|
232
232
|
`?` after the **type** = nullable, `?` after the **variable name** = optional (not required).
|
|
233
233
|
|
|
234
|
-
> **Full reference:** See `
|
|
234
|
+
> **Full reference:** See `xano_xanoscript_docs({ topic: "types" })` for complete input types and validation options.
|
|
235
235
|
|
|
236
236
|
```xs
|
|
237
237
|
input {
|
|
@@ -289,7 +289,7 @@ $val|first_notnull:"default" // Default if null
|
|
|
289
289
|
$val ?? "default" // Nullish coalescing
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
> **Full reference:** See `
|
|
292
|
+
> **Full reference:** See `xano_xanoscript_docs({ topic: "syntax" })` for all 100+ filters organized by category (string, array, object, type, date, encoding).
|
|
293
293
|
|
|
294
294
|
### String Concatenation
|
|
295
295
|
|
|
@@ -409,7 +409,7 @@ var $response_data {
|
|
|
409
409
|
|
|
410
410
|
### 5. Date/Time Operations
|
|
411
411
|
|
|
412
|
-
> **Full reference:** See `
|
|
412
|
+
> **Full reference:** See `xano_xanoscript_docs({ topic: "syntax" })` for all date/time filters.
|
|
413
413
|
|
|
414
414
|
```xs
|
|
415
415
|
var $now { value = now }
|
|
@@ -644,7 +644,7 @@ Each `.xs` file must contain exactly **one** construct. Placing two constructs i
|
|
|
644
644
|
|
|
645
645
|
## Related Topics
|
|
646
646
|
|
|
647
|
-
Explore more with `
|
|
647
|
+
Explore more with `xano_xanoscript_docs({ topic: "<topic>" })`:
|
|
648
648
|
|
|
649
649
|
| Topic | Description |
|
|
650
650
|
|-------|-------------|
|
|
@@ -81,7 +81,7 @@ Reference with path: `function.run "math/add" { ... }`
|
|
|
81
81
|
|
|
82
82
|
## Input Block
|
|
83
83
|
|
|
84
|
-
For complete type and filter reference, use `
|
|
84
|
+
For complete type and filter reference, use `xano_xanoscript_docs({ topic: "types" })`.
|
|
85
85
|
|
|
86
86
|
`?` after the **type** = nullable (`text?`), `?` after the **variable name** = not required (`age?`).
|
|
87
87
|
|
|
@@ -183,7 +183,7 @@ stack {
|
|
|
183
183
|
|
|
184
184
|
### Error Handling
|
|
185
185
|
|
|
186
|
-
For complete error handling reference (preconditions, try-catch, throw, early return), use `
|
|
186
|
+
For complete error handling reference (preconditions, try-catch, throw, early return), use `xano_xanoscript_docs({ topic: "syntax" })`.
|
|
187
187
|
|
|
188
188
|
---
|
|
189
189
|
|
|
@@ -464,7 +464,7 @@ foreach ($items) {
|
|
|
464
464
|
|
|
465
465
|
## Related Topics
|
|
466
466
|
|
|
467
|
-
Explore more with `
|
|
467
|
+
Explore more with `xano_xanoscript_docs({ topic: "<topic>" })`:
|
|
468
468
|
|
|
469
469
|
| Topic | Description |
|
|
470
470
|
|-------|-------------|
|
|
@@ -10,11 +10,11 @@ applyTo: "function/**/*.xs, api/**/*.xs, task/*.xs"
|
|
|
10
10
|
|
|
11
11
|
| Topic | Command | Contents |
|
|
12
12
|
|-------|---------|----------|
|
|
13
|
-
| Cloud Storage | `
|
|
14
|
-
| Search | `
|
|
15
|
-
| Redis | `
|
|
16
|
-
| External APIs | `
|
|
17
|
-
| Utilities | `
|
|
13
|
+
| Cloud Storage | `xano_xanoscript_docs({ topic: "integrations/cloud-storage" })` | AWS S3, Azure Blob, GCP Storage |
|
|
14
|
+
| Search | `xano_xanoscript_docs({ topic: "integrations/search" })` | Elasticsearch, OpenSearch, Algolia |
|
|
15
|
+
| Redis | `xano_xanoscript_docs({ topic: "integrations/redis" })` | Caching, rate limiting, queues |
|
|
16
|
+
| External APIs | `xano_xanoscript_docs({ topic: "integrations/external-apis" })` | api.request patterns |
|
|
17
|
+
| Utilities | `xano_xanoscript_docs({ topic: "integrations/utilities" })` | Local storage, security, email, zip, Lambda |
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -280,7 +280,7 @@ middleware "cache_response" {
|
|
|
280
280
|
|
|
281
281
|
## Applying Middleware
|
|
282
282
|
|
|
283
|
-
Middleware is configured at the branch level. See `
|
|
283
|
+
Middleware is configured at the branch level. See `xano_xanoscript_docs({ topic: "branch" })` for configuration details.
|
|
284
284
|
|
|
285
285
|
```xs
|
|
286
286
|
branch "production" {
|
|
@@ -137,7 +137,7 @@ db.bulk.add "order_item" {
|
|
|
137
137
|
|
|
138
138
|
## Caching Strategies
|
|
139
139
|
|
|
140
|
-
> See `
|
|
140
|
+
> See `xano_xanoscript_docs({ topic: "integrations/redis" })` for full Redis caching patterns (get/set, invalidation, computed value caching).
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
@@ -157,7 +157,7 @@ db.query "product" {
|
|
|
157
157
|
|
|
158
158
|
## Rate Limiting
|
|
159
159
|
|
|
160
|
-
For basic rate limiting setup, see `
|
|
160
|
+
For basic rate limiting setup, see `xano_xanoscript_docs({ topic: "security" })`. Below are performance-focused patterns.
|
|
161
161
|
|
|
162
162
|
### Tiered Limits
|
|
163
163
|
|
|
@@ -187,7 +187,7 @@ redis.ratelimit {
|
|
|
187
187
|
|
|
188
188
|
For large responses, use `return = { type: "stream" }` with `api.stream` to avoid loading into memory. Large JSON responses are automatically compressed when clients support it.
|
|
189
189
|
|
|
190
|
-
> See `
|
|
190
|
+
> See `xano_xanoscript_docs({ topic: "streaming" })` for streaming patterns.
|
|
191
191
|
|
|
192
192
|
---
|
|
193
193
|
|
|
@@ -195,7 +195,7 @@ For large responses, use `return = { type: "stream" }` with `api.stream` to avoi
|
|
|
195
195
|
|
|
196
196
|
Use `now|to_ms` before and after operations to measure duration, and `debug.log` to log slow queries.
|
|
197
197
|
|
|
198
|
-
> See `
|
|
198
|
+
> See `xano_xanoscript_docs({ topic: "debugging" })` for timing and logging patterns.
|
|
199
199
|
|
|
200
200
|
---
|
|
201
201
|
|
|
@@ -261,7 +261,7 @@ api.realtime_event {
|
|
|
261
261
|
|
|
262
262
|
## Realtime Triggers
|
|
263
263
|
|
|
264
|
-
Handle events from connected clients using `realtime_trigger`. For complete trigger syntax, input schemas, and configuration options, see `
|
|
264
|
+
Handle events from connected clients using `realtime_trigger`. For complete trigger syntax, input schemas, and configuration options, see `xano_xanoscript_docs({ topic: "triggers" })`.
|
|
265
265
|
|
|
266
266
|
---
|
|
267
267
|
|
|
@@ -286,7 +286,7 @@ api.realtime_event {
|
|
|
286
286
|
|
|
287
287
|
Clients subscribe to channels client-side. Server controls what events to send. Validate channel access with preconditions before broadcasting.
|
|
288
288
|
|
|
289
|
-
> See `
|
|
289
|
+
> See `xano_xanoscript_docs({ topic: "security" })` for authorization patterns.
|
|
290
290
|
|
|
291
291
|
---
|
|
292
292
|
|
|
@@ -258,7 +258,7 @@ security.jws_decode {
|
|
|
258
258
|
} as $claims
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
> See `
|
|
261
|
+
> See `xano_xanoscript_docs({ topic: "integrations/utilities" })` for JWE, key generation, and other security utilities.
|
|
262
262
|
|
|
263
263
|
---
|
|
264
264
|
|
|
@@ -4,7 +4,7 @@ applyTo: "**/*.xs"
|
|
|
4
4
|
|
|
5
5
|
# XanoScript Survival Kit
|
|
6
6
|
|
|
7
|
-
> Minimal reference for writing valid XanoScript. For more: `
|
|
7
|
+
> Minimal reference for writing valid XanoScript. For more: `xano_xanoscript_docs({ topic: "<topic>" })`.
|
|
8
8
|
|
|
9
9
|
## Quick Reference
|
|
10
10
|
|
|
@@ -163,7 +163,7 @@ $data|csv_create // Create CSV string
|
|
|
163
163
|
|
|
164
164
|
## Security Filters
|
|
165
165
|
|
|
166
|
-
> **Full reference:** See `
|
|
166
|
+
> **Full reference:** See `xano_xanoscript_docs({ topic: "security" })` for security best practices.
|
|
167
167
|
|
|
168
168
|
| Filter | Example |
|
|
169
169
|
|--------|---------|
|