@xano/developer-mcp 1.0.74 → 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.
Files changed (129) hide show
  1. package/README.md +104 -37
  2. package/dist/cli_docs/index.d.ts +13 -37
  3. package/dist/cli_docs/index.js +28 -39
  4. package/dist/cli_docs/topics/integration.js +1 -1
  5. package/dist/cli_docs/topics/workspace.js +1 -1
  6. package/dist/index.js +58 -55
  7. package/dist/lib.d.ts +3 -1
  8. package/dist/lib.js +1 -1
  9. package/dist/meta_api_docs/format.js +1 -1
  10. package/dist/meta_api_docs/index.d.ts +14 -42
  11. package/dist/meta_api_docs/index.js +34 -46
  12. package/dist/tools/cli_docs.d.ts +2 -3
  13. package/dist/tools/cli_docs.js +3 -5
  14. package/dist/tools/define_tool.d.ts +47 -0
  15. package/dist/tools/define_tool.js +36 -0
  16. package/dist/tools/index.d.ts +88 -221
  17. package/dist/tools/index.js +80 -109
  18. package/dist/tools/mcp_version.d.ts +4 -25
  19. package/dist/tools/mcp_version.js +12 -19
  20. package/dist/tools/meta_api_docs.d.ts +2 -3
  21. package/dist/tools/meta_api_docs.js +3 -5
  22. package/dist/tools/validate_xanoscript.d.ts +18 -65
  23. package/dist/tools/validate_xanoscript.js +56 -54
  24. package/dist/tools/xanoscript_docs.d.ts +25 -74
  25. package/dist/tools/xanoscript_docs.js +86 -83
  26. package/dist/xanoscript_docs/README.md +5 -5
  27. package/dist/xanoscript_docs/addons.md +1 -3
  28. package/dist/xanoscript_docs/apis.md +2 -2
  29. package/dist/xanoscript_docs/database.md +1 -1
  30. package/dist/xanoscript_docs/essentials.md +6 -6
  31. package/dist/xanoscript_docs/functions.md +3 -3
  32. package/dist/xanoscript_docs/integrations.md +5 -5
  33. package/dist/xanoscript_docs/middleware.md +1 -1
  34. package/dist/xanoscript_docs/performance.md +4 -4
  35. package/dist/xanoscript_docs/realtime.md +2 -2
  36. package/dist/xanoscript_docs/security.md +3 -6
  37. package/dist/xanoscript_docs/survival.md +1 -1
  38. package/dist/xanoscript_docs/syntax/string-filters.md +1 -1
  39. package/dist/xanoscript_docs/syntax.md +10 -12
  40. package/dist/xanoscript_docs/tasks.md +1 -2
  41. package/dist/xanoscript_docs/tools.md +3 -5
  42. package/dist/xanoscript_docs/types.md +2 -2
  43. package/dist/xanoscript_docs/unit-testing.md +1 -1
  44. package/dist/xanoscript_docs/workflow-tests.md +1 -1
  45. package/dist/xanoscript_docs/working.md +4 -4
  46. package/package.json +5 -4
  47. package/dist/api_docs/format.d.ts +0 -5
  48. package/dist/api_docs/format.js +0 -171
  49. package/dist/api_docs/index.d.ts +0 -52
  50. package/dist/api_docs/index.js +0 -111
  51. package/dist/api_docs/topics/agent.d.ts +0 -2
  52. package/dist/api_docs/topics/agent.js +0 -142
  53. package/dist/api_docs/topics/api.d.ts +0 -2
  54. package/dist/api_docs/topics/api.js +0 -176
  55. package/dist/api_docs/topics/apigroup.d.ts +0 -2
  56. package/dist/api_docs/topics/apigroup.js +0 -124
  57. package/dist/api_docs/topics/authentication.d.ts +0 -2
  58. package/dist/api_docs/topics/authentication.js +0 -61
  59. package/dist/api_docs/topics/branch.d.ts +0 -2
  60. package/dist/api_docs/topics/branch.js +0 -73
  61. package/dist/api_docs/topics/file.d.ts +0 -2
  62. package/dist/api_docs/topics/file.js +0 -70
  63. package/dist/api_docs/topics/function.d.ts +0 -2
  64. package/dist/api_docs/topics/function.js +0 -164
  65. package/dist/api_docs/topics/history.d.ts +0 -2
  66. package/dist/api_docs/topics/history.js +0 -149
  67. package/dist/api_docs/topics/mcp_server.d.ts +0 -2
  68. package/dist/api_docs/topics/mcp_server.js +0 -139
  69. package/dist/api_docs/topics/middleware.d.ts +0 -2
  70. package/dist/api_docs/topics/middleware.js +0 -156
  71. package/dist/api_docs/topics/realtime.d.ts +0 -2
  72. package/dist/api_docs/topics/realtime.js +0 -112
  73. package/dist/api_docs/topics/start.d.ts +0 -2
  74. package/dist/api_docs/topics/start.js +0 -107
  75. package/dist/api_docs/topics/table.d.ts +0 -2
  76. package/dist/api_docs/topics/table.js +0 -195
  77. package/dist/api_docs/topics/task.d.ts +0 -2
  78. package/dist/api_docs/topics/task.js +0 -165
  79. package/dist/api_docs/topics/tool.d.ts +0 -2
  80. package/dist/api_docs/topics/tool.js +0 -150
  81. package/dist/api_docs/topics/workflows.d.ts +0 -2
  82. package/dist/api_docs/topics/workflows.js +0 -131
  83. package/dist/api_docs/topics/workspace.d.ts +0 -2
  84. package/dist/api_docs/topics/workspace.js +0 -153
  85. package/dist/api_docs/types.d.ts +0 -79
  86. package/dist/api_docs/types.js +0 -4
  87. package/dist/cli_docs/topics/run.d.ts +0 -2
  88. package/dist/cli_docs/topics/run.js +0 -248
  89. package/dist/meta_api_docs/format.test.d.ts +0 -1
  90. package/dist/meta_api_docs/format.test.js +0 -272
  91. package/dist/meta_api_docs/index.test.d.ts +0 -1
  92. package/dist/meta_api_docs/index.test.js +0 -128
  93. package/dist/meta_api_docs/types.test.d.ts +0 -1
  94. package/dist/meta_api_docs/types.test.js +0 -132
  95. package/dist/templates/init-workspace.d.ts +0 -10
  96. package/dist/templates/init-workspace.js +0 -278
  97. package/dist/templates/xanoscript-index.d.ts +0 -11
  98. package/dist/templates/xanoscript-index.js +0 -72
  99. package/dist/tools/index.test.d.ts +0 -1
  100. package/dist/tools/index.test.js +0 -179
  101. package/dist/tools/xanoscript_docs.test.d.ts +0 -1
  102. package/dist/tools/xanoscript_docs.test.js +0 -197
  103. package/dist/xanoscript.test.d.ts +0 -1
  104. package/dist/xanoscript.test.js +0 -421
  105. package/dist/xanoscript_docs/cheatsheet.md +0 -287
  106. package/dist/xanoscript_docs/ephemeral.md +0 -330
  107. package/dist/xanoscript_docs/quickstart.md +0 -692
  108. package/dist/xanoscript_docs/run.md +0 -196
  109. package/dist/xanoscript_docs/schema.md +0 -300
  110. package/dist/xanoscript_docs_auto/README.md +0 -119
  111. package/dist/xanoscript_docs_auto/agents.md +0 -446
  112. package/dist/xanoscript_docs_auto/apis.md +0 -517
  113. package/dist/xanoscript_docs_auto/control-flow.md +0 -543
  114. package/dist/xanoscript_docs_auto/database.md +0 -551
  115. package/dist/xanoscript_docs_auto/debugging.md +0 -527
  116. package/dist/xanoscript_docs_auto/filters.md +0 -464
  117. package/dist/xanoscript_docs_auto/functions.md +0 -431
  118. package/dist/xanoscript_docs_auto/integrations.md +0 -657
  119. package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
  120. package/dist/xanoscript_docs_auto/operators.md +0 -368
  121. package/dist/xanoscript_docs_auto/syntax.md +0 -287
  122. package/dist/xanoscript_docs_auto/tables.md +0 -447
  123. package/dist/xanoscript_docs_auto/tasks.md +0 -479
  124. package/dist/xanoscript_docs_auto/testing.md +0 -574
  125. package/dist/xanoscript_docs_auto/tools.md +0 -485
  126. package/dist/xanoscript_docs_auto/triggers.md +0 -595
  127. package/dist/xanoscript_docs_auto/types.md +0 -323
  128. package/dist/xanoscript_docs_auto/variables.md +0 -462
  129. package/dist/xanoscript_docs_auto/version.json +0 -5
@@ -25,9 +25,9 @@ Complete reference for XanoScript expressions, operators, and core filters. For
25
25
  ### Extended Filter Sub-Topics
26
26
 
27
27
  For detailed references on specific filter categories, use:
28
- - `xanoscript_docs({ topic: "syntax/string-filters" })` — String filters, regex, encoding, security filters, text functions
29
- - `xanoscript_docs({ topic: "syntax/array-filters" })` — Array filters, functional operations, array functions
30
- - `xanoscript_docs({ topic: "syntax/functions" })` — Math filters/functions, object functions, bitwise operations
28
+ - `xano_xanoscript_docs({ topic: "syntax/string-filters" })` — String filters, regex, encoding, security filters, text functions
29
+ - `xano_xanoscript_docs({ topic: "syntax/array-filters" })` — Array filters, functional operations, array functions
30
+ - `xano_xanoscript_docs({ topic: "syntax/functions" })` — Math filters/functions, object functions, bitwise operations
31
31
 
32
32
  ## CRITICAL: Filters Are Type-Specific
33
33
 
@@ -85,7 +85,7 @@ Working with...
85
85
 
86
86
  ### Variable Access Prefixes
87
87
 
88
- > **Full reference:** See `xanoscript_docs({ topic: "essentials" })` for detailed variable access rules, reserved variables, and type names.
88
+ > **Full reference:** See `xano_xanoscript_docs({ topic: "essentials" })` for detailed variable access rules, reserved variables, and type names.
89
89
 
90
90
  | Prefix | Applies to | Shorthand? |
91
91
  |--------|-----------|------------|
@@ -256,7 +256,7 @@ $db.post.date >=? $input.start_date
256
256
 
257
257
  ## Type Filters
258
258
 
259
- > **Full reference:** For input types and validation, see `xanoscript_docs({ topic: "types" })`.
259
+ > **Full reference:** For input types and validation, see `xano_xanoscript_docs({ topic: "types" })`.
260
260
 
261
261
  | Filter | Example | Result |
262
262
  |--------|---------|--------|
@@ -321,7 +321,7 @@ $ts|timestamp_day_of_week // Day (0=Sunday)
321
321
 
322
322
  ## DB Query Filters
323
323
 
324
- > **Full reference:** For complete database operations, see `xanoscript_docs({ topic: "database" })`.
324
+ > **Full reference:** For complete database operations, see `xano_xanoscript_docs({ topic: "database" })`.
325
325
 
326
326
  Used in `db.query` where clauses:
327
327
 
@@ -355,9 +355,7 @@ Additional operators for `db.query` where clauses:
355
355
 
356
356
  ```xs
357
357
  db.query "product" {
358
- where = $db.product.status not in ["deleted", "archived"]
359
- && $db.product.metadata @> {"featured": true}
360
- && $db.product.sku ~ "^SKU-[0-9]+"
358
+ where = $db.product.status not in ["deleted", "archived"] && $db.product.metadata @> {"featured": true} && $db.product.sku ~ "^SKU-[0-9]+"
361
359
  } as $products
362
360
  ```
363
361
 
@@ -380,7 +378,7 @@ $db.created_at|timestamp_epoch_ms // Milliseconds since epoch
380
378
 
381
379
  ### Vector Operations (AI/ML)
382
380
 
383
- > **Full reference:** For AI agents and embeddings, see `xanoscript_docs({ topic: "agents" })`.
381
+ > **Full reference:** For AI agents and embeddings, see `xano_xanoscript_docs({ topic: "agents" })`.
384
382
 
385
383
  ```xs
386
384
  $db.embedding|l1_distance_manhattan:$input.vector // L1/Manhattan distance
@@ -395,7 +393,7 @@ $db.boundary|covers:$input.point // Polygon covers point
395
393
 
396
394
  ### Preconditions
397
395
 
398
- Validate conditions and throw typed errors. See `xanoscript_docs({ topic: "essentials" })` for the error types reference table.
396
+ Validate conditions and throw typed errors. See `xano_xanoscript_docs({ topic: "essentials" })` for the error types reference table.
399
397
 
400
398
  ```xs
401
399
  precondition ($input.amount > 0) {
@@ -496,7 +494,7 @@ var $api_key { value = $env.MY_API_KEY }
496
494
 
497
495
  ## Related Topics
498
496
 
499
- Explore more with `xanoscript_docs({ topic: "<topic>" })`:
497
+ Explore more with `xano_xanoscript_docs({ topic: "<topic>" })`:
500
498
 
501
499
  | Topic | Description |
502
500
  |-------|-------------|
@@ -149,8 +149,7 @@ task "daily_digest" {
149
149
  foreach ($users) {
150
150
  each as $user {
151
151
  db.query "notification" {
152
- where = $db.notification.user_id == $user.id
153
- && $db.notification.sent == false
152
+ where = $db.notification.user_id == $user.id && $db.notification.sent == false
154
153
  } as $notifications
155
154
 
156
155
  conditional {
@@ -66,7 +66,7 @@ tool "get_user_by_email" {
66
66
 
67
67
  ## Input Block
68
68
 
69
- For complete type reference, use `xanoscript_docs({ topic: "types" })`. For tools, input `description` fields are sent to the AI, so write them clearly:
69
+ For complete type reference, use `xano_xanoscript_docs({ topic: "types" })`. For tools, input `description` fields are sent to the AI, so write them clearly:
70
70
 
71
71
  ```xs
72
72
  input {
@@ -194,9 +194,7 @@ tool "search_products" {
194
194
  }
195
195
  stack {
196
196
  db.query "product" {
197
- where = $db.product.name includes? $input.query
198
- && $db.product.category ==? $input.category
199
- && $db.product.is_active == true
197
+ where = $db.product.name includes? $input.query && $db.product.category ==? $input.category && $db.product.is_active == true
200
198
  return = { type: "list", paging: { page: 1, per_page: $input.limit } }
201
199
  } as $products
202
200
  }
@@ -258,7 +256,7 @@ tool "get_order_with_items" {
258
256
 
259
257
  ## Error Handling
260
258
 
261
- For complete error handling reference (preconditions, try-catch, throw, error types), see `xanoscript_docs({ topic: "syntax" })`.
259
+ For complete error handling reference (preconditions, try-catch, throw, error types), see `xano_xanoscript_docs({ topic: "syntax" })`.
262
260
 
263
261
  ```xs
264
262
  tool "cancel_order" {
@@ -421,7 +421,7 @@ input {
421
421
 
422
422
  ## Validation with Preconditions
423
423
 
424
- For complex validation beyond filters, use preconditions. For complete error handling reference, use `xanoscript_docs({ topic: "syntax" })`.
424
+ For complex validation beyond filters, use preconditions. For complete error handling reference, use `xano_xanoscript_docs({ topic: "syntax" })`.
425
425
 
426
426
  ```xs
427
427
  precondition ($input.start_date < $input.end_date) {
@@ -442,7 +442,7 @@ precondition ($input.start_date < $input.end_date) {
442
442
 
443
443
  ## Related Topics
444
444
 
445
- Explore more with `xanoscript_docs({ topic: "<topic>" })`:
445
+ Explore more with `xano_xanoscript_docs({ topic: "<topic>" })`:
446
446
 
447
447
  | Topic | Description |
448
448
  |-------|-------------|
@@ -366,7 +366,7 @@ function "create_user" {
366
366
  }
367
367
  ```
368
368
 
369
- For a full breakdown of what each required/optional/nullable combination accepts, see `xanoscript_docs({ topic: "types" })`.
369
+ For a full breakdown of what each required/optional/nullable combination accepts, see `xano_xanoscript_docs({ topic: "types" })`.
370
370
 
371
371
  ---
372
372
 
@@ -296,7 +296,7 @@ workflow_test "comprehensive_test" {
296
296
 
297
297
  1. **Use `function.call`, not `function.run`** — `function.call` handles errors so that `expect` assertions work correctly
298
298
  2. **Keep tests independent** — Each workflow test should be self-contained
299
- 3. **Don't test required fields with empty strings** — Required inputs reject `""` at the platform level. Use optional fields (`text name?`) to test blank cases. See `xanoscript_docs({ topic: "types" })`
299
+ 3. **Don't test required fields with empty strings** — Required inputs reject `""` at the platform level. Use optional fields (`text name?`) to test blank cases. See `xano_xanoscript_docs({ topic: "types" })`
300
300
 
301
301
  ---
302
302
 
@@ -4,7 +4,7 @@ applyTo: "**/*.xs"
4
4
 
5
5
  # XanoScript Working Reference
6
6
 
7
- > Complete reference for common XanoScript development. Call `xanoscript_docs({ topic: "<topic>" })` for specialized topics.
7
+ > Complete reference for common XanoScript development. Call `xano_xanoscript_docs({ topic: "<topic>" })` for specialized topics.
8
8
 
9
9
  ## Quick Reference
10
10
 
@@ -380,7 +380,7 @@ function.run "send_notification" {
380
380
  }
381
381
  ```
382
382
 
383
- > For async patterns, recursion, and advanced function features: `xanoscript_docs({ topic: "functions" })`
383
+ > For async patterns, recursion, and advanced function features: `xano_xanoscript_docs({ topic: "functions" })`
384
384
 
385
385
  ---
386
386
 
@@ -475,7 +475,7 @@ db.transaction {
475
475
  }
476
476
  ```
477
477
 
478
- > For bulk operations, direct SQL, vector search, and advanced queries: `xanoscript_docs({ topic: "database" })`
478
+ > For bulk operations, direct SQL, vector search, and advanced queries: `xano_xanoscript_docs({ topic: "database" })`
479
479
 
480
480
  ---
481
481
 
@@ -555,7 +555,7 @@ query "users/{user_id}" verb=DELETE {
555
555
  }
556
556
  ```
557
557
 
558
- > For API groups, rate limiting, file uploads, and custom headers: `xanoscript_docs({ topic: "apis" })`
558
+ > For API groups, rate limiting, file uploads, and custom headers: `xano_xanoscript_docs({ topic: "apis" })`
559
559
 
560
560
  ---
561
561
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/developer-mcp",
3
- "version": "1.0.74",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
5
5
  "type": "module",
6
6
  "main": "dist/lib.js",
@@ -30,9 +30,9 @@
30
30
  "dist"
31
31
  ],
32
32
  "scripts": {
33
- "build": "tsc && cp -r src/xanoscript_docs dist/",
33
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && cp -r src/xanoscript_docs dist/",
34
34
  "start": "node dist/index.js",
35
- "dev": "tsc && node dist/index.js",
35
+ "dev": "npm run build && node dist/index.js",
36
36
  "test": "vitest run",
37
37
  "test:watch": "vitest",
38
38
  "test:coverage": "vitest run --coverage",
@@ -62,7 +62,8 @@
62
62
  "dependencies": {
63
63
  "@modelcontextprotocol/sdk": "^1.26.0",
64
64
  "@xano/xanoscript-language-server": "^12.0.0",
65
- "minimatch": "^10.1.2"
65
+ "minimatch": "^10.1.2",
66
+ "zod": "^4.0.0"
66
67
  },
67
68
  "devDependencies": {
68
69
  "@types/minimatch": "^5.1.2",
@@ -1,5 +0,0 @@
1
- /**
2
- * Formatting utilities for API documentation output
3
- */
4
- import type { TopicDoc, DetailLevel } from "./types.js";
5
- export declare function formatDocumentation(doc: TopicDoc, detailLevel?: DetailLevel, includeSchemas?: boolean): string;
@@ -1,171 +0,0 @@
1
- /**
2
- * Formatting utilities for API documentation output
3
- */
4
- /**
5
- * Base URL information included with any topic that has endpoints
6
- */
7
- const BASE_URL_INFO = `## Base URL
8
- \`\`\`
9
- https://<your-instance-subdomain>.xano.io/api:meta/<endpoint>
10
- \`\`\`
11
- Authorization: \`Bearer <your-access-token>\`
12
- `;
13
- function formatParameter(param) {
14
- const required = param.required ? " (required)" : "";
15
- const defaultVal = param.default !== undefined ? ` [default: ${param.default}]` : "";
16
- const enumVals = param.enum ? ` [options: ${param.enum.join(", ")}]` : "";
17
- return ` - \`${param.name}\`: ${param.type}${required}${defaultVal}${enumVals} - ${param.description}`;
18
- }
19
- function formatEndpoint(ep, detailLevel) {
20
- const lines = [];
21
- // Method and path
22
- lines.push(`### ${ep.method} ${ep.path}`);
23
- if (ep.tool_name) {
24
- lines.push(`**Tool:** \`${ep.tool_name}\``);
25
- }
26
- lines.push("");
27
- lines.push(ep.description);
28
- if (detailLevel === "overview") {
29
- return lines.join("\n");
30
- }
31
- // Parameters
32
- if (ep.parameters?.length) {
33
- lines.push("");
34
- lines.push("**Parameters:**");
35
- for (const param of ep.parameters) {
36
- lines.push(formatParameter(param));
37
- }
38
- }
39
- // Request body
40
- if (ep.request_body) {
41
- lines.push("");
42
- lines.push(`**Request Body:** \`${ep.request_body.type}\``);
43
- if (ep.request_body.properties) {
44
- for (const [key, val] of Object.entries(ep.request_body.properties)) {
45
- const req = val.required ? " (required)" : "";
46
- lines.push(` - \`${key}\`: ${val.type}${req} - ${val.description || ""}`);
47
- }
48
- }
49
- }
50
- // Example (only in detailed/examples mode)
51
- if (detailLevel === "examples" && ep.example) {
52
- lines.push("");
53
- lines.push("**Example:**");
54
- lines.push("```");
55
- lines.push(`${ep.example.method} ${ep.example.path}`);
56
- if (ep.example.body) {
57
- lines.push(JSON.stringify(ep.example.body, null, 2));
58
- }
59
- lines.push("```");
60
- }
61
- return lines.join("\n");
62
- }
63
- function formatExample(ex) {
64
- const lines = [];
65
- lines.push(`### ${ex.title}`);
66
- lines.push("");
67
- lines.push(ex.description);
68
- lines.push("");
69
- lines.push("**Request:**");
70
- lines.push("```");
71
- lines.push(`${ex.request.method} ${ex.request.path}`);
72
- if (ex.request.headers) {
73
- for (const [key, val] of Object.entries(ex.request.headers)) {
74
- lines.push(`${key}: ${val}`);
75
- }
76
- }
77
- if (ex.request.body) {
78
- lines.push("");
79
- lines.push(JSON.stringify(ex.request.body, null, 2));
80
- }
81
- lines.push("```");
82
- if (ex.response !== undefined) {
83
- lines.push("");
84
- lines.push("**Response:**");
85
- lines.push("```json");
86
- lines.push(JSON.stringify(ex.response, null, 2));
87
- lines.push("```");
88
- }
89
- return lines.join("\n");
90
- }
91
- function formatPattern(pattern) {
92
- const lines = [];
93
- lines.push(`### ${pattern.name}`);
94
- if (pattern.description) {
95
- lines.push("");
96
- lines.push(pattern.description);
97
- }
98
- lines.push("");
99
- lines.push("**Steps:**");
100
- for (const step of pattern.steps) {
101
- lines.push(step);
102
- }
103
- if (pattern.example) {
104
- lines.push("");
105
- lines.push("**Example:**");
106
- lines.push("```");
107
- lines.push(pattern.example);
108
- lines.push("```");
109
- }
110
- return lines.join("\n");
111
- }
112
- export function formatDocumentation(doc, detailLevel = "detailed", includeSchemas = true) {
113
- const sections = [];
114
- // Header
115
- sections.push(`# ${doc.title}`);
116
- sections.push("");
117
- sections.push(doc.description);
118
- // AI Hints (always include for AI optimization)
119
- if (doc.ai_hints) {
120
- sections.push("");
121
- sections.push("## AI Usage Hints");
122
- sections.push(doc.ai_hints);
123
- }
124
- // Include base URL info if topic has endpoints or patterns (workflows)
125
- if (doc.endpoints?.length || doc.patterns?.length) {
126
- sections.push("");
127
- sections.push(BASE_URL_INFO);
128
- }
129
- // Endpoints
130
- if (doc.endpoints?.length) {
131
- sections.push("## Endpoints");
132
- for (const ep of doc.endpoints) {
133
- sections.push("");
134
- sections.push(formatEndpoint(ep, detailLevel));
135
- }
136
- }
137
- // Patterns/Workflows
138
- if (doc.patterns?.length) {
139
- sections.push("");
140
- sections.push("## Workflows");
141
- for (const pattern of doc.patterns) {
142
- sections.push("");
143
- sections.push(formatPattern(pattern));
144
- }
145
- }
146
- // Examples
147
- if ((detailLevel === "detailed" || detailLevel === "examples") && doc.examples?.length) {
148
- sections.push("");
149
- sections.push("## Examples");
150
- for (const ex of doc.examples) {
151
- sections.push("");
152
- sections.push(formatExample(ex));
153
- }
154
- }
155
- // Schemas
156
- if (includeSchemas && doc.schemas && Object.keys(doc.schemas).length > 0) {
157
- sections.push("");
158
- sections.push("## Schemas");
159
- sections.push("");
160
- sections.push("```json");
161
- sections.push(JSON.stringify(doc.schemas, null, 2));
162
- sections.push("```");
163
- }
164
- // Related topics
165
- if (doc.related_topics?.length) {
166
- sections.push("");
167
- sections.push("## Related Topics");
168
- sections.push(`Use \`api_docs\` with topic: ${doc.related_topics.join(", ")}`);
169
- }
170
- return sections.join("\n");
171
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * Xano Meta API Documentation Index
3
- *
4
- * This module exports all documentation topics and provides
5
- * the api_docs tool handler for the MCP server.
6
- */
7
- import type { TopicDoc, ApiDocsArgs } from "./types.js";
8
- /**
9
- * All available documentation topics
10
- */
11
- export declare const topics: Record<string, TopicDoc>;
12
- /**
13
- * Get list of all available topic names
14
- */
15
- export declare function getTopicNames(): string[];
16
- /**
17
- * Get topic descriptions for tool documentation
18
- */
19
- export declare function getTopicDescriptions(): string;
20
- /**
21
- * Handler for the api_docs tool
22
- */
23
- export declare function handleApiDocs(args: ApiDocsArgs): string;
24
- /**
25
- * Tool definition for MCP server
26
- */
27
- export declare const apiDocsToolDefinition: {
28
- name: string;
29
- description: string;
30
- inputSchema: {
31
- type: string;
32
- properties: {
33
- topic: {
34
- type: string;
35
- enum: string[];
36
- description: string;
37
- };
38
- detail_level: {
39
- type: string;
40
- enum: string[];
41
- default: string;
42
- description: string;
43
- };
44
- include_schemas: {
45
- type: string;
46
- default: boolean;
47
- description: string;
48
- };
49
- };
50
- required: string[];
51
- };
52
- };
@@ -1,111 +0,0 @@
1
- /**
2
- * Xano Meta API Documentation Index
3
- *
4
- * This module exports all documentation topics and provides
5
- * the api_docs tool handler for the MCP server.
6
- */
7
- import { formatDocumentation } from "./format.js";
8
- // Import all topic documentation
9
- import { startDoc } from "./topics/start.js";
10
- import { authenticationDoc } from "./topics/authentication.js";
11
- import { workspaceDoc } from "./topics/workspace.js";
12
- import { apigroupDoc } from "./topics/apigroup.js";
13
- import { apiDoc } from "./topics/api.js";
14
- import { tableDoc } from "./topics/table.js";
15
- import { functionDoc } from "./topics/function.js";
16
- import { taskDoc } from "./topics/task.js";
17
- import { agentDoc } from "./topics/agent.js";
18
- import { toolDoc } from "./topics/tool.js";
19
- import { mcpServerDoc } from "./topics/mcp_server.js";
20
- import { middlewareDoc } from "./topics/middleware.js";
21
- import { branchDoc } from "./topics/branch.js";
22
- import { realtimeDoc } from "./topics/realtime.js";
23
- import { fileDoc } from "./topics/file.js";
24
- import { historyDoc } from "./topics/history.js";
25
- import { workflowsDoc } from "./topics/workflows.js";
26
- /**
27
- * All available documentation topics
28
- */
29
- export const topics = {
30
- start: startDoc,
31
- authentication: authenticationDoc,
32
- workspace: workspaceDoc,
33
- apigroup: apigroupDoc,
34
- api: apiDoc,
35
- table: tableDoc,
36
- function: functionDoc,
37
- task: taskDoc,
38
- agent: agentDoc,
39
- tool: toolDoc,
40
- mcp_server: mcpServerDoc,
41
- middleware: middlewareDoc,
42
- branch: branchDoc,
43
- realtime: realtimeDoc,
44
- file: fileDoc,
45
- history: historyDoc,
46
- workflows: workflowsDoc,
47
- };
48
- /**
49
- * Get list of all available topic names
50
- */
51
- export function getTopicNames() {
52
- return Object.keys(topics);
53
- }
54
- /**
55
- * Get topic descriptions for tool documentation
56
- */
57
- export function getTopicDescriptions() {
58
- return Object.entries(topics)
59
- .map(([key, doc]) => `- ${key}: ${doc.title}`)
60
- .join("\n");
61
- }
62
- /**
63
- * Handler for the api_docs tool
64
- */
65
- export function handleApiDocs(args) {
66
- const { topic, detail_level = "detailed", include_schemas = true } = args;
67
- // Validate topic
68
- if (!topics[topic]) {
69
- const available = getTopicNames().join(", ");
70
- return `Error: Unknown topic "${topic}".\n\nAvailable topics: ${available}`;
71
- }
72
- const doc = topics[topic];
73
- return formatDocumentation(doc, detail_level, include_schemas);
74
- }
75
- /**
76
- * Tool definition for MCP server
77
- */
78
- export const apiDocsToolDefinition = {
79
- name: "api_docs",
80
- description: `Get documentation for Xano's Meta API. Use this to understand how to programmatically manage Xano workspaces, databases, APIs, functions, agents, and more.
81
-
82
- ## Topics
83
- ${getTopicDescriptions()}
84
-
85
- ## Usage
86
- - Start with "start" topic for overview and getting started
87
- - Use "workflows" for step-by-step guides
88
- - Use specific topics (workspace, table, api, etc.) for detailed endpoint docs`,
89
- inputSchema: {
90
- type: "object",
91
- properties: {
92
- topic: {
93
- type: "string",
94
- enum: getTopicNames(),
95
- description: "Documentation topic to retrieve",
96
- },
97
- detail_level: {
98
- type: "string",
99
- enum: ["overview", "detailed", "examples"],
100
- default: "detailed",
101
- description: "Level of detail: overview (brief), detailed (full docs), examples (with code examples)",
102
- },
103
- include_schemas: {
104
- type: "boolean",
105
- default: true,
106
- description: "Include JSON schemas for requests/responses",
107
- },
108
- },
109
- required: ["topic"],
110
- },
111
- };
@@ -1,2 +0,0 @@
1
- import type { TopicDoc } from "../types.js";
2
- export declare const agentDoc: TopicDoc;