@xano/developer-mcp 2.2.4 → 2.2.6-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.
@@ -1,7 +1,9 @@
1
1
  export const realtimeDoc = {
2
2
  topic: "realtime",
3
- title: "Realtime Channel Management",
4
- description: `Realtime channels enable WebSocket-based push notifications and live updates to connected clients.
3
+ title: "Legacy Realtime Channel Management",
4
+ description: `These endpoints describe legacy Realtime. For Realtime V2, use xano_xanoscript_docs({ topic: "realtime-v2" }) and the workspace XanoScript push/pull workflow.
5
+
6
+ Realtime channels enable WebSocket-based push notifications and live updates to connected clients.
5
7
 
6
8
  ## Key Concepts
7
9
  - Channels are WebSocket endpoints for real-time communication
@@ -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()
@@ -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
  */
@@ -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" || (!args?.topic && !args?.file_path)) {
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
 
@@ -241,7 +243,8 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
241
243
  | `file-uploads` | Uploading files to native Xano storage | `file?` input, create_attachment, signed URLs |
242
244
  | `tasks` | Scheduled and cron jobs | Cron Syntax, Input Handling |
243
245
  | `triggers` | Event-driven handlers (table, realtime, workspace, agent, MCP) | Predefined Inputs, Event Types |
244
- | `realtime` | Real-time channels and events for push updates | Channels, Events |
246
+ | `realtime` | Legacy V1 channels and events | Channels, Events |
247
+ | `realtime-v2` | V2 servers, channels, message handlers, and publishing | WebSocket Client, Authentication, Join Triggers |
245
248
 
246
249
  ### AI & Agents
247
250
 
@@ -280,4 +283,3 @@ Use `xano_xanoscript_docs({ tier: "survival" })` or `xano_xanoscript_docs({ tier
280
283
  | ------------- | ------------------------------------------------------------ | ------------ |
281
284
  | `performance` | Performance optimization best practices | Caching, Query Optimization |
282
285
  | `security` | Security best practices for authentication and authorization | Auth Patterns, Token Handling |
283
-
@@ -43,6 +43,8 @@ query "endpoint-path" verb=<METHOD> {
43
43
  }
44
44
  ```
45
45
 
46
+ To attach post middleware to this endpoint, add `middleware = { post: [{name: "docs_post"}] }` inside the `query` declaration, alongside `response`. Define the referenced middleware first. See `xano_xanoscript_docs({ topic: "middleware" })` for the fixed input contract and complete examples.
47
+
46
48
  ### Query Name (Required, Non-Empty)
47
49
 
48
50
  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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.3.0",
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", "expressions"]
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",
@@ -212,10 +225,35 @@
212
225
  },
213
226
  "realtime": {
214
227
  "file": "realtime.md",
215
- "description": "Real-time channels and events for push updates",
216
- "applyTo": ["realtime/channel/*.xs", "realtime/trigger/*.xs"],
228
+ "description": "Legacy Realtime V1 channels and events; use realtime-v2 for servers, channels, and message handlers",
229
+ "applyTo": [
230
+ "realtime/channel/*.xs",
231
+ "realtime/trigger/*.xs"
232
+ ],
233
+ "priority": 3,
234
+ "aliases": [
235
+ "realtime-v1",
236
+ "legacy-realtime"
237
+ ]
238
+ },
239
+ "realtime-v2": {
240
+ "file": "realtime-v2.md",
241
+ "description": "Realtime V2 servers, typed channel paths, message handlers, native WebSocket clients, publishing, and join authorization",
242
+ "applyTo": [
243
+ "realtime_server/**/*.xs",
244
+ "channel/**/*.xs",
245
+ "message/**/*.xs",
246
+ "channel_trigger/**/*.xs",
247
+ "realtime_server_trigger/**/*.xs"
248
+ ],
217
249
  "priority": 3,
218
- "aliases": ["websocket", "channels", "pubsub"]
250
+ "aliases": [
251
+ "websocket",
252
+ "channels",
253
+ "pubsub",
254
+ "realtime2",
255
+ "realtime_v2"
256
+ ]
219
257
  },
220
258
  "security": {
221
259
  "file": "security.md",
@@ -232,7 +270,7 @@
232
270
  },
233
271
  "middleware": {
234
272
  "file": "middleware.md",
235
- "description": "Request/response interceptors for functions, queries, tasks, and tools",
273
+ "description": "API post middleware attachment, fixed inputs, and merge/replace response handling",
236
274
  "applyTo": ["middleware/*.xs"],
237
275
  "priority": 3,
238
276
  "aliases": ["interceptors", "hooks"]
@@ -324,10 +362,17 @@
324
362
  "mcp_server_trigger": { "file": "triggers.md", "section": "mcp-server-trigger" },
325
363
  "addon": { "file": "addons.md" },
326
364
  "middleware": { "file": "middleware.md" },
327
- "realtime_channel": { "file": "realtime.md" }
365
+ "realtime_channel": { "file": "realtime.md" },
366
+ "realtime_server": { "file": "realtime-v2.md" },
367
+ "channel": { "file": "realtime-v2.md" },
368
+ "message": { "file": "realtime-v2.md" },
369
+ "channel_trigger": { "file": "realtime-v2.md" },
370
+ "realtime_server_trigger": { "file": "realtime-v2.md" }
328
371
  },
329
372
 
330
373
  "operations": {
374
+ "realtime.publish": { "file": "realtime-v2.md" },
375
+ "realtime.get_session": { "file": "realtime-v2.md" },
331
376
  "db.query": { "file": "database.md" },
332
377
  "db.get": { "file": "database.md" },
333
378
  "db.has": { "file": "database.md" },
@@ -422,6 +467,7 @@
422
467
  "authorization": ["security.md"],
423
468
  "rate_limiting": ["security.md", "integrations/redis.md"],
424
469
  "error_handling": ["syntax.md", "essentials.md"],
470
+ "data_transformation": ["expressions.md", "syntax/array-filters.md"],
425
471
  "pagination": ["database.md", "apis.md"],
426
472
  "file_upload": ["file-uploads.md", "integrations/cloud-storage.md", "streaming.md"],
427
473
  "caching": ["performance.md", "integrations/redis.md"],