@xano/developer-mcp 2.2.3 → 2.2.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.
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/xanoscript_docs.d.ts +1 -0
- package/dist/tools/xanoscript_docs.js +8 -0
- package/dist/xanoscript.d.ts +10 -0
- package/dist/xanoscript.js +73 -1
- package/dist/xanoscript_docs/README.md +2 -0
- package/dist/xanoscript_docs/docs_index.json +16 -2
- package/dist/xanoscript_docs/expressions/filters.md +2166 -0
- package/dist/xanoscript_docs/expressions.md +189 -0
- package/dist/xanoscript_docs/mcp-servers.md +76 -0
- package/dist/xanoscript_docs/syntax/array-filters.md +4 -2
- package/dist/xanoscript_docs/syntax.md +7 -2
- package/dist/xanoscript_docs/version.json +2 -2
- package/package.json +3 -2
package/dist/tools/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare const toolSpecs: {
|
|
|
38
38
|
readonly xano_xanoscript_docs: BuiltTool<{
|
|
39
39
|
topic: z.ZodOptional<z.ZodString>;
|
|
40
40
|
file_path: z.ZodOptional<z.ZodString>;
|
|
41
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
41
42
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
42
43
|
index: "index";
|
|
43
44
|
full: "full";
|
|
@@ -54,6 +54,7 @@ export declare function xanoscriptDocsTool(args?: XanoscriptDocsArgs): ToolResul
|
|
|
54
54
|
export declare const xanoscriptDocsToolSpec: import("./define_tool.js").BuiltTool<{
|
|
55
55
|
topic: z.ZodOptional<z.ZodString>;
|
|
56
56
|
file_path: z.ZodOptional<z.ZodString>;
|
|
57
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
57
58
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
58
59
|
index: "index";
|
|
59
60
|
full: "full";
|
|
@@ -165,6 +165,7 @@ export const xanoscriptDocsToolSpec = defineTool({
|
|
|
165
165
|
"Call without parameters for a compact index of all topics (~4KB, ~1K tokens); then drill in with topic= or file_path=. Use topic='readme' for the full prose overview (previously the no-arg default). " +
|
|
166
166
|
`For context-limited models: use tier='survival' (~${tierFacts.survival.tokens}) or tier='working' (~${tierFacts.working.tokens}). ` +
|
|
167
167
|
"Use 'topic' for specific documentation, or 'file_path' for context-aware docs based on the file you're editing. " +
|
|
168
|
+
"Use 'filter' to fetch just one or a few expression filter signatures by name (e.g. filter='round') instead of the whole filter reference. " +
|
|
168
169
|
"Use mode='quick_reference' for compact syntax reference (recommended for context efficiency). " +
|
|
169
170
|
"Use max_tokens to limit documentation size to fit your context budget. " +
|
|
170
171
|
"file_path mode defaults to 'quick_reference' to reduce context size; use mode='full' to get complete docs.",
|
|
@@ -190,6 +191,13 @@ export const xanoscriptDocsToolSpec = defineTool({
|
|
|
190
191
|
"Uses applyTo pattern matching to select applicable topics. " +
|
|
191
192
|
"Example: 'api/users/create.xs' returns API, database, and syntax docs. " +
|
|
192
193
|
"'function/format.xs' returns function and syntax docs."),
|
|
194
|
+
filter: z
|
|
195
|
+
.string()
|
|
196
|
+
.optional()
|
|
197
|
+
.describe("One or more expression filter (transformer) names, comma-separated, to retrieve just those entries from the expression filter reference: signature, arguments with defaults, and a worked example. " +
|
|
198
|
+
"Accepts display names and canonical aliases, case-insensitive (e.g. filter='round', filter='fsort' or 'sort', filter='to_upper,split,map'). " +
|
|
199
|
+
"Much cheaper than loading topic='expressions/filters' (~12.7K tokens) when you only need a few signatures. " +
|
|
200
|
+
"Takes precedence over topic and file_path; an unknown name returns suggestions."),
|
|
193
201
|
mode: z
|
|
194
202
|
.enum(["full", "quick_reference", "index"])
|
|
195
203
|
.optional()
|
package/dist/xanoscript.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface DocConfig {
|
|
|
18
18
|
export interface XanoscriptDocsArgs {
|
|
19
19
|
topic?: string;
|
|
20
20
|
file_path?: string;
|
|
21
|
+
filter?: string;
|
|
21
22
|
mode?: "full" | "quick_reference" | "index";
|
|
22
23
|
tier?: "survival" | "working";
|
|
23
24
|
max_tokens?: number;
|
|
@@ -64,6 +65,15 @@ export declare function getDocsForFilePath(filePath: string): string[];
|
|
|
64
65
|
* (Common Mistakes, Decision/Choosing trees) from a doc.
|
|
65
66
|
*/
|
|
66
67
|
export declare function extractQuickReference(content: string, topic: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Extract individual filter entries from the expression filter reference
|
|
70
|
+
* (expressions/filters.md) by name. Accepts display names and canonical
|
|
71
|
+
* aliases, case-insensitive, comma-separated for multiple filters. A name that
|
|
72
|
+
* maps to more than one entry (e.g. "min" is both the canonical alias of
|
|
73
|
+
* array_min and the display name of num_min) returns all matching entries,
|
|
74
|
+
* since the engine picks by input type.
|
|
75
|
+
*/
|
|
76
|
+
export declare function extractFilterDocs(docsPath: string, filterQuery: string): string;
|
|
67
77
|
/**
|
|
68
78
|
* Get the documentation version from the version.json file
|
|
69
79
|
*/
|
package/dist/xanoscript.js
CHANGED
|
@@ -165,6 +165,70 @@ export function extractQuickReference(content, topic) {
|
|
|
165
165
|
const header = `# ${topic}\n\n`;
|
|
166
166
|
return header + sections.join("\n\n---\n\n");
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Extract individual filter entries from the expression filter reference
|
|
170
|
+
* (expressions/filters.md) by name. Accepts display names and canonical
|
|
171
|
+
* aliases, case-insensitive, comma-separated for multiple filters. A name that
|
|
172
|
+
* maps to more than one entry (e.g. "min" is both the canonical alias of
|
|
173
|
+
* array_min and the display name of num_min) returns all matching entries,
|
|
174
|
+
* since the engine picks by input type.
|
|
175
|
+
*/
|
|
176
|
+
export function extractFilterDocs(docsPath, filterQuery) {
|
|
177
|
+
const content = cachedReadFile(join(docsPath, "expressions/filters.md"));
|
|
178
|
+
const lines = content.split("\n");
|
|
179
|
+
const headingRe = /^### `([^`]+)`(?: \(alias `([^`]+)`\))?/;
|
|
180
|
+
const sections = [];
|
|
181
|
+
for (let i = 0; i < lines.length; i++) {
|
|
182
|
+
const m = lines[i].match(headingRe);
|
|
183
|
+
if (!m)
|
|
184
|
+
continue;
|
|
185
|
+
let end = lines.findIndex((l, j) => j > i && (l.startsWith("### ") || l.startsWith("## ")));
|
|
186
|
+
if (end === -1)
|
|
187
|
+
end = lines.length;
|
|
188
|
+
const names = [m[1].toLowerCase()];
|
|
189
|
+
if (m[2])
|
|
190
|
+
names.push(m[2].toLowerCase());
|
|
191
|
+
sections.push({ names, start: i, end });
|
|
192
|
+
}
|
|
193
|
+
const requested = filterQuery
|
|
194
|
+
.split(",")
|
|
195
|
+
.map((s) => s.trim())
|
|
196
|
+
.filter(Boolean);
|
|
197
|
+
if (requested.length === 0) {
|
|
198
|
+
throw new Error("filter must name at least one filter, e.g. filter='round' or filter='to_upper,split'");
|
|
199
|
+
}
|
|
200
|
+
const picked = [];
|
|
201
|
+
const notFound = [];
|
|
202
|
+
for (const name of requested) {
|
|
203
|
+
const lower = name.toLowerCase();
|
|
204
|
+
const matches = sections.filter((s) => s.names.includes(lower));
|
|
205
|
+
if (matches.length === 0) {
|
|
206
|
+
notFound.push(name);
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
for (const s of matches) {
|
|
210
|
+
if (!picked.includes(s))
|
|
211
|
+
picked.push(s);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (notFound.length > 0) {
|
|
215
|
+
const allNames = [...new Set(sections.flatMap((s) => s.names))];
|
|
216
|
+
const suggestions = [
|
|
217
|
+
...new Set(notFound.flatMap((n) => {
|
|
218
|
+
const q = n.toLowerCase();
|
|
219
|
+
return allNames.filter((a) => a.includes(q) || (a.length >= 3 && q.includes(a)));
|
|
220
|
+
})),
|
|
221
|
+
];
|
|
222
|
+
throw new Error(`Unknown filter${notFound.length > 1 ? "s" : ""}: ${notFound.join(", ")}.` +
|
|
223
|
+
(suggestions.length > 0 ? ` Did you mean: ${suggestions.join(", ")}?` : "") +
|
|
224
|
+
` Use topic='expressions/filters' with mode='quick_reference' for the full name list.`);
|
|
225
|
+
}
|
|
226
|
+
picked.sort((a, b) => a.start - b.start);
|
|
227
|
+
const body = picked
|
|
228
|
+
.map((s) => lines.slice(s.start, s.end).join("\n").trim())
|
|
229
|
+
.join("\n\n---\n\n");
|
|
230
|
+
return `# Expression Filter Documentation: ${requested.join(", ")}\n\n${body}`;
|
|
231
|
+
}
|
|
168
232
|
/**
|
|
169
233
|
* Get the documentation version from the version.json file
|
|
170
234
|
*/
|
|
@@ -237,7 +301,8 @@ export function readXanoscriptDocsV2(docsPath, args) {
|
|
|
237
301
|
// Returns a compact topic listing with byte sizes and token estimates plus
|
|
238
302
|
// orientation pointers, so a bare discovery call costs ~4KB instead of the
|
|
239
303
|
// full README. The README is still reachable via topic='readme'.
|
|
240
|
-
if (args?.mode === "index" ||
|
|
304
|
+
if (args?.mode === "index" ||
|
|
305
|
+
(!args?.topic && !args?.file_path && !args?.filter)) {
|
|
241
306
|
// survival/working are whole-corpus digests reached via tier=, not granular
|
|
242
307
|
// topic= targets — listing them as table rows invites topic='survival' calls
|
|
243
308
|
// (a different, non-tier code path). They are surfaced in Next steps instead.
|
|
@@ -271,6 +336,7 @@ export function readXanoscriptDocsV2(docsPath, args) {
|
|
|
271
336
|
`- topic='readme' — full overview (workspace structure, core syntax patterns, type names)`,
|
|
272
337
|
`- topic='<name>' — load one topic (e.g. 'syntax', 'database', 'apis')`,
|
|
273
338
|
`- file_path='api/users/create.xs' — auto-select the docs for the file you're editing`,
|
|
339
|
+
`- filter='round' — one expression filter's signature and example (comma-separate for several, e.g. filter='to_upper,split')`,
|
|
274
340
|
`- tier='survival' (~${tiers.survival.tokens}) or tier='working' (~${tiers.working.tokens}) for context-limited models`,
|
|
275
341
|
`- mode='quick_reference' — compact output when you only need a reminder`,
|
|
276
342
|
`- max_tokens=4000 with file_path= — stop loading once the budget is reached`,
|
|
@@ -280,6 +346,12 @@ export function readXanoscriptDocsV2(docsPath, args) {
|
|
|
280
346
|
`Documentation version: ${version}`,
|
|
281
347
|
].join("\n");
|
|
282
348
|
}
|
|
349
|
+
// Filter lookup: return individual entries from the expression filter
|
|
350
|
+
// reference instead of a whole topic
|
|
351
|
+
if (args?.filter) {
|
|
352
|
+
const doc = extractFilterDocs(docsPath, args.filter);
|
|
353
|
+
return `${doc}\n\n---\nDocumentation version: ${version}`;
|
|
354
|
+
}
|
|
283
355
|
// Default to quick_reference for file_path mode (loads many topics),
|
|
284
356
|
// full for topic mode (loads single topic)
|
|
285
357
|
const mode = args?.mode || (args?.file_path ? "quick_reference" : "full");
|
|
@@ -221,6 +221,8 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
|
|
|
221
221
|
| `syntax/string-filters` | String manipulation filters | Case, Trim, Split, Replace |
|
|
222
222
|
| `syntax/array-filters` | Array manipulation filters | Map, Filter, Sort, Group |
|
|
223
223
|
| `syntax/functions` | Built-in functions | Math, Date, Crypto, JSON |
|
|
224
|
+
| `expressions` | Xano expression language: inline data transformations | `$$` Filters, Anchoring Variables, Transformers, `set` |
|
|
225
|
+
| `expressions/filters` | Signatures and examples for all 210 expression filters | Math, Array, Text, Manipulation, Transform, Security, Timestamp |
|
|
224
226
|
| `types` | Data types, validation, input blocks | Validation Filters, Input Blocks |
|
|
225
227
|
| `functions` | Reusable function stacks, async, loops | Loops, Async Patterns |
|
|
226
228
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.7.1",
|
|
3
3
|
"description": "Machine-readable index for XanoScript documentation (version mirrors version.json)",
|
|
4
4
|
|
|
5
5
|
"topics": {
|
|
@@ -35,7 +35,20 @@
|
|
|
35
35
|
"description": "Expressions, operators, and filters for all XanoScript code",
|
|
36
36
|
"applyTo": ["**/*.xs"],
|
|
37
37
|
"priority": 1,
|
|
38
|
-
"aliases": ["filters", "operators"
|
|
38
|
+
"aliases": ["filters", "operators"]
|
|
39
|
+
},
|
|
40
|
+
"expressions": {
|
|
41
|
+
"file": "expressions.md",
|
|
42
|
+
"description": "Xano expression language: inline data transformations with $$ filters, anchoring variables, and transformer pipes",
|
|
43
|
+
"applyTo": ["**/*.xs"],
|
|
44
|
+
"priority": 6,
|
|
45
|
+
"aliases": ["expression", "expr", "xano-expressions", "transformers", "anchoring"]
|
|
46
|
+
},
|
|
47
|
+
"expressions/filters": {
|
|
48
|
+
"file": "expressions/filters.md",
|
|
49
|
+
"description": "Signatures, arguments, and worked examples for all 210 expression filters (transformers)",
|
|
50
|
+
"applyTo": [],
|
|
51
|
+
"aliases": ["filter-reference", "transformer-reference", "filter-signatures", "expression-filters"]
|
|
39
52
|
},
|
|
40
53
|
"syntax/string-filters": {
|
|
41
54
|
"file": "syntax/string-filters.md",
|
|
@@ -422,6 +435,7 @@
|
|
|
422
435
|
"authorization": ["security.md"],
|
|
423
436
|
"rate_limiting": ["security.md", "integrations/redis.md"],
|
|
424
437
|
"error_handling": ["syntax.md", "essentials.md"],
|
|
438
|
+
"data_transformation": ["expressions.md", "syntax/array-filters.md"],
|
|
425
439
|
"pagination": ["database.md", "apis.md"],
|
|
426
440
|
"file_upload": ["file-uploads.md", "integrations/cloud-storage.md", "streaming.md"],
|
|
427
441
|
"caching": ["performance.md", "integrations/redis.md"],
|