@xano/developer-mcp 1.0.75 → 2.0.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 (127) 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/apis.md +2 -2
  28. package/dist/xanoscript_docs/database.md +1 -1
  29. package/dist/xanoscript_docs/essentials.md +6 -6
  30. package/dist/xanoscript_docs/functions.md +3 -3
  31. package/dist/xanoscript_docs/integrations.md +5 -5
  32. package/dist/xanoscript_docs/middleware.md +1 -1
  33. package/dist/xanoscript_docs/performance.md +4 -4
  34. package/dist/xanoscript_docs/realtime.md +2 -2
  35. package/dist/xanoscript_docs/security.md +1 -1
  36. package/dist/xanoscript_docs/survival.md +1 -1
  37. package/dist/xanoscript_docs/syntax/string-filters.md +1 -1
  38. package/dist/xanoscript_docs/syntax.md +9 -9
  39. package/dist/xanoscript_docs/tools.md +2 -2
  40. package/dist/xanoscript_docs/types.md +2 -2
  41. package/dist/xanoscript_docs/unit-testing.md +1 -1
  42. package/dist/xanoscript_docs/workflow-tests.md +1 -1
  43. package/dist/xanoscript_docs/working.md +4 -4
  44. package/package.json +5 -4
  45. package/dist/api_docs/format.d.ts +0 -5
  46. package/dist/api_docs/format.js +0 -171
  47. package/dist/api_docs/index.d.ts +0 -52
  48. package/dist/api_docs/index.js +0 -111
  49. package/dist/api_docs/topics/agent.d.ts +0 -2
  50. package/dist/api_docs/topics/agent.js +0 -142
  51. package/dist/api_docs/topics/api.d.ts +0 -2
  52. package/dist/api_docs/topics/api.js +0 -176
  53. package/dist/api_docs/topics/apigroup.d.ts +0 -2
  54. package/dist/api_docs/topics/apigroup.js +0 -124
  55. package/dist/api_docs/topics/authentication.d.ts +0 -2
  56. package/dist/api_docs/topics/authentication.js +0 -61
  57. package/dist/api_docs/topics/branch.d.ts +0 -2
  58. package/dist/api_docs/topics/branch.js +0 -73
  59. package/dist/api_docs/topics/file.d.ts +0 -2
  60. package/dist/api_docs/topics/file.js +0 -70
  61. package/dist/api_docs/topics/function.d.ts +0 -2
  62. package/dist/api_docs/topics/function.js +0 -164
  63. package/dist/api_docs/topics/history.d.ts +0 -2
  64. package/dist/api_docs/topics/history.js +0 -149
  65. package/dist/api_docs/topics/mcp_server.d.ts +0 -2
  66. package/dist/api_docs/topics/mcp_server.js +0 -139
  67. package/dist/api_docs/topics/middleware.d.ts +0 -2
  68. package/dist/api_docs/topics/middleware.js +0 -156
  69. package/dist/api_docs/topics/realtime.d.ts +0 -2
  70. package/dist/api_docs/topics/realtime.js +0 -112
  71. package/dist/api_docs/topics/start.d.ts +0 -2
  72. package/dist/api_docs/topics/start.js +0 -107
  73. package/dist/api_docs/topics/table.d.ts +0 -2
  74. package/dist/api_docs/topics/table.js +0 -195
  75. package/dist/api_docs/topics/task.d.ts +0 -2
  76. package/dist/api_docs/topics/task.js +0 -165
  77. package/dist/api_docs/topics/tool.d.ts +0 -2
  78. package/dist/api_docs/topics/tool.js +0 -150
  79. package/dist/api_docs/topics/workflows.d.ts +0 -2
  80. package/dist/api_docs/topics/workflows.js +0 -131
  81. package/dist/api_docs/topics/workspace.d.ts +0 -2
  82. package/dist/api_docs/topics/workspace.js +0 -153
  83. package/dist/api_docs/types.d.ts +0 -79
  84. package/dist/api_docs/types.js +0 -4
  85. package/dist/cli_docs/topics/run.d.ts +0 -2
  86. package/dist/cli_docs/topics/run.js +0 -248
  87. package/dist/meta_api_docs/format.test.d.ts +0 -1
  88. package/dist/meta_api_docs/format.test.js +0 -272
  89. package/dist/meta_api_docs/index.test.d.ts +0 -1
  90. package/dist/meta_api_docs/index.test.js +0 -128
  91. package/dist/meta_api_docs/types.test.d.ts +0 -1
  92. package/dist/meta_api_docs/types.test.js +0 -132
  93. package/dist/templates/init-workspace.d.ts +0 -10
  94. package/dist/templates/init-workspace.js +0 -278
  95. package/dist/templates/xanoscript-index.d.ts +0 -11
  96. package/dist/templates/xanoscript-index.js +0 -72
  97. package/dist/tools/index.test.d.ts +0 -1
  98. package/dist/tools/index.test.js +0 -179
  99. package/dist/tools/xanoscript_docs.test.d.ts +0 -1
  100. package/dist/tools/xanoscript_docs.test.js +0 -197
  101. package/dist/xanoscript.test.d.ts +0 -1
  102. package/dist/xanoscript.test.js +0 -421
  103. package/dist/xanoscript_docs/cheatsheet.md +0 -287
  104. package/dist/xanoscript_docs/ephemeral.md +0 -330
  105. package/dist/xanoscript_docs/quickstart.md +0 -692
  106. package/dist/xanoscript_docs/run.md +0 -196
  107. package/dist/xanoscript_docs/schema.md +0 -300
  108. package/dist/xanoscript_docs_auto/README.md +0 -119
  109. package/dist/xanoscript_docs_auto/agents.md +0 -446
  110. package/dist/xanoscript_docs_auto/apis.md +0 -517
  111. package/dist/xanoscript_docs_auto/control-flow.md +0 -543
  112. package/dist/xanoscript_docs_auto/database.md +0 -551
  113. package/dist/xanoscript_docs_auto/debugging.md +0 -527
  114. package/dist/xanoscript_docs_auto/filters.md +0 -464
  115. package/dist/xanoscript_docs_auto/functions.md +0 -431
  116. package/dist/xanoscript_docs_auto/integrations.md +0 -657
  117. package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
  118. package/dist/xanoscript_docs_auto/operators.md +0 -368
  119. package/dist/xanoscript_docs_auto/syntax.md +0 -287
  120. package/dist/xanoscript_docs_auto/tables.md +0 -447
  121. package/dist/xanoscript_docs_auto/tasks.md +0 -479
  122. package/dist/xanoscript_docs_auto/testing.md +0 -574
  123. package/dist/xanoscript_docs_auto/tools.md +0 -485
  124. package/dist/xanoscript_docs_auto/triggers.md +0 -595
  125. package/dist/xanoscript_docs_auto/types.md +0 -323
  126. package/dist/xanoscript_docs_auto/variables.md +0 -462
  127. 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
 
@@ -378,7 +378,7 @@ $db.created_at|timestamp_epoch_ms // Milliseconds since epoch
378
378
 
379
379
  ### Vector Operations (AI/ML)
380
380
 
381
- > **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" })`.
382
382
 
383
383
  ```xs
384
384
  $db.embedding|l1_distance_manhattan:$input.vector // L1/Manhattan distance
@@ -393,7 +393,7 @@ $db.boundary|covers:$input.point // Polygon covers point
393
393
 
394
394
  ### Preconditions
395
395
 
396
- 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.
397
397
 
398
398
  ```xs
399
399
  precondition ($input.amount > 0) {
@@ -494,7 +494,7 @@ var $api_key { value = $env.MY_API_KEY }
494
494
 
495
495
  ## Related Topics
496
496
 
497
- Explore more with `xanoscript_docs({ topic: "<topic>" })`:
497
+ Explore more with `xano_xanoscript_docs({ topic: "<topic>" })`:
498
498
 
499
499
  | Topic | Description |
500
500
  |-------|-------------|
@@ -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 {
@@ -256,7 +256,7 @@ tool "get_order_with_items" {
256
256
 
257
257
  ## Error Handling
258
258
 
259
- 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" })`.
260
260
 
261
261
  ```xs
262
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.75",
3
+ "version": "2.0.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;
@@ -1,142 +0,0 @@
1
- export const agentDoc = {
2
- topic: "agent",
3
- title: "AI Agent Management",
4
- description: `Agents are AI-powered automation units that use LLMs (like Claude) to make decisions and execute multi-step workflows.
5
-
6
- ## Key Concepts
7
- - Agents use LLMs for reasoning and decision-making
8
- - Can call tools to perform actions
9
- - Support multiple LLM providers (Anthropic, OpenAI, etc.)
10
- - Configurable system prompts, temperature, max steps
11
- - Can have triggers that invoke them automatically
12
-
13
- ## LLM Configuration
14
- - Type: Provider (e.g., "anthropic")
15
- - Model: Specific model (e.g., "claude-4-sonnet-20250514")
16
- - System prompt: Instructions for the agent
17
- - Temperature: Creativity level (0-1)
18
- - Max steps: Maximum reasoning iterations
19
- - Reasoning: Enable/disable chain-of-thought`,
20
- ai_hints: `- Create tools first, then create agent and associate tools
21
- - System prompt is critical for agent behavior
22
- - Lower temperature = more deterministic responses
23
- - Max steps limits runaway agent loops
24
- - Use triggers to invoke agents on events (table changes, etc.)`,
25
- endpoints: [
26
- {
27
- method: "GET",
28
- path: "/workspace/{workspace_id}/agent",
29
- tool_name: "listAgents",
30
- description: "List all AI agents in a workspace.",
31
- parameters: [
32
- { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
33
- { name: "page", type: "integer", default: 1, description: "Page number" },
34
- { name: "per_page", type: "integer", default: 50, description: "Items per page" },
35
- { name: "search", type: "string", description: "Search by agent name" },
36
- { name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript definition" },
37
- { name: "include_draft", type: "boolean", default: false, description: "Include draft versions" }
38
- ]
39
- },
40
- {
41
- method: "GET",
42
- path: "/workspace/{workspace_id}/agent/{agent_id}",
43
- tool_name: "getAgent",
44
- description: "Get details of a specific AI agent.",
45
- parameters: [
46
- { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
47
- { name: "agent_id", type: "integer", required: true, in: "path", description: "Agent ID" },
48
- { name: "include_xanoscript", type: "boolean", default: false, description: "Include XanoScript definition" },
49
- { name: "include_draft", type: "boolean", default: false, description: "Include draft version" }
50
- ]
51
- },
52
- {
53
- method: "POST",
54
- path: "/workspace/{workspace_id}/agent",
55
- tool_name: "createAgent",
56
- description: "Create a new AI agent with LLM configuration.",
57
- parameters: [
58
- { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" }
59
- ],
60
- request_body: {
61
- type: "application/json",
62
- properties: {
63
- name: { type: "string", description: "Agent name", required: true },
64
- description: { type: "string", description: "Agent description" },
65
- xanoscript: { type: "string", description: "XanoScript agent definition", required: true }
66
- }
67
- },
68
- example: {
69
- method: "POST",
70
- path: "/workspace/1/agent",
71
- body: {
72
- name: "support_agent",
73
- description: "Customer support AI agent",
74
- xanoscript: `agent support_agent {
75
- llm {
76
- type = "anthropic"
77
- model = "claude-4-sonnet-20250514"
78
- system_prompt = "You are a helpful customer support agent."
79
- max_steps = 10
80
- temperature = 0.3
81
- }
82
- tools = [lookup_order, update_ticket]
83
- }`
84
- }
85
- }
86
- },
87
- {
88
- method: "PUT",
89
- path: "/workspace/{workspace_id}/agent/{agent_id}",
90
- tool_name: "updateAgent",
91
- description: "Update an existing AI agent.",
92
- parameters: [
93
- { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
94
- { name: "agent_id", type: "integer", required: true, in: "path", description: "Agent ID" },
95
- { name: "publish", type: "boolean", default: true, description: "Publish changes immediately" }
96
- ],
97
- request_body: {
98
- type: "application/json",
99
- properties: {
100
- name: { type: "string", description: "Agent name" },
101
- description: { type: "string", description: "Agent description" },
102
- xanoscript: { type: "string", description: "XanoScript agent definition" }
103
- }
104
- }
105
- },
106
- {
107
- method: "DELETE",
108
- path: "/workspace/{workspace_id}/agent/{agent_id}",
109
- tool_name: "deleteAgent",
110
- description: "Delete an AI agent.",
111
- parameters: [
112
- { name: "workspace_id", type: "integer", required: true, in: "path", description: "Workspace ID" },
113
- { name: "agent_id", type: "integer", required: true, in: "path", description: "Agent ID" }
114
- ]
115
- }
116
- ],
117
- schemas: {
118
- Agent: {
119
- type: "object",
120
- properties: {
121
- id: { type: "integer" },
122
- name: { type: "string" },
123
- description: { type: "string" },
124
- llm: {
125
- type: "object",
126
- properties: {
127
- type: { type: "string", description: "LLM provider (anthropic, openai, etc.)" },
128
- model: { type: "string", description: "Model identifier" },
129
- system_prompt: { type: "string" },
130
- max_steps: { type: "integer" },
131
- temperature: { type: "number" },
132
- reasoning: { type: "boolean" }
133
- }
134
- },
135
- tools: { type: "array", items: { type: "string" } },
136
- created_at: { type: "string", format: "date-time" },
137
- updated_at: { type: "string", format: "date-time" }
138
- }
139
- }
140
- },
141
- related_topics: ["tool", "mcp_server", "function"]
142
- };