@xano/developer-mcp 1.0.21 → 1.0.22

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 (48) hide show
  1. package/README.md +100 -19
  2. package/dist/index.js +4 -242
  3. package/dist/meta_api_docs/format.d.ts +16 -1
  4. package/dist/meta_api_docs/format.js +24 -6
  5. package/dist/meta_api_docs/format.test.d.ts +1 -0
  6. package/dist/meta_api_docs/format.test.js +274 -0
  7. package/dist/meta_api_docs/index.test.d.ts +1 -0
  8. package/dist/meta_api_docs/index.test.js +128 -0
  9. package/dist/meta_api_docs/types.test.d.ts +1 -0
  10. package/dist/meta_api_docs/types.test.js +132 -0
  11. package/dist/run_api_docs/format.d.ts +1 -0
  12. package/dist/run_api_docs/format.js +3 -170
  13. package/dist/run_api_docs/format.test.d.ts +1 -0
  14. package/dist/run_api_docs/format.test.js +86 -0
  15. package/dist/run_api_docs/index.test.d.ts +1 -0
  16. package/dist/run_api_docs/index.test.js +127 -0
  17. package/dist/xanoscript.d.ts +41 -0
  18. package/dist/xanoscript.js +261 -0
  19. package/dist/xanoscript.test.d.ts +1 -0
  20. package/dist/xanoscript.test.js +303 -0
  21. package/dist/xanoscript_docs/README.md +2 -0
  22. package/dist/xanoscript_docs/agents.md +1 -1
  23. package/dist/xanoscript_docs/functions.md +4 -4
  24. package/dist/xanoscript_docs/integrations.md +43 -1
  25. package/dist/xanoscript_docs/performance.md +1 -1
  26. package/dist/xanoscript_docs/tasks.md +2 -2
  27. package/dist/xanoscript_docs/tools.md +2 -2
  28. package/dist/xanoscript_docs_auto/README.md +119 -0
  29. package/dist/xanoscript_docs_auto/agents.md +446 -0
  30. package/dist/xanoscript_docs_auto/apis.md +517 -0
  31. package/dist/xanoscript_docs_auto/control-flow.md +543 -0
  32. package/dist/xanoscript_docs_auto/database.md +551 -0
  33. package/dist/xanoscript_docs_auto/debugging.md +527 -0
  34. package/dist/xanoscript_docs_auto/filters.md +464 -0
  35. package/dist/xanoscript_docs_auto/functions.md +431 -0
  36. package/dist/xanoscript_docs_auto/integrations.md +657 -0
  37. package/dist/xanoscript_docs_auto/mcp-servers.md +408 -0
  38. package/dist/xanoscript_docs_auto/operators.md +368 -0
  39. package/dist/xanoscript_docs_auto/syntax.md +287 -0
  40. package/dist/xanoscript_docs_auto/tables.md +447 -0
  41. package/dist/xanoscript_docs_auto/tasks.md +479 -0
  42. package/dist/xanoscript_docs_auto/testing.md +574 -0
  43. package/dist/xanoscript_docs_auto/tools.md +485 -0
  44. package/dist/xanoscript_docs_auto/triggers.md +595 -0
  45. package/dist/xanoscript_docs_auto/types.md +323 -0
  46. package/dist/xanoscript_docs_auto/variables.md +462 -0
  47. package/dist/xanoscript_docs_auto/version.json +5 -0
  48. package/package.json +6 -2
package/README.md CHANGED
@@ -355,31 +355,40 @@ The server also exposes XanoScript documentation as MCP resources for direct acc
355
355
  | `build` | `tsc` | Compile TypeScript to JavaScript |
356
356
  | `start` | `node dist/index.js` | Run the MCP server |
357
357
  | `dev` | `tsc && node dist/index.js` | Build and run in development |
358
+ | `test` | `vitest run` | Run unit tests |
359
+ | `test:watch` | `vitest` | Run tests in watch mode |
360
+ | `test:coverage` | `vitest run --coverage` | Run tests with coverage report |
358
361
 
359
362
  ## Project Structure
360
363
 
361
364
  ```
362
365
  xano-developer-mcp/
363
366
  ├── src/
364
- │ ├── index.ts # Main MCP server implementation
365
- │ ├── xanoscript.d.ts # TypeScript declarations
366
- │ ├── meta_api_docs/ # Meta API documentation
367
- ├── index.ts # API docs tool handler
368
- ├── types.ts # Type definitions
369
- │ │ ├── format.ts # Documentation formatter
370
- │ │ └── topics/ # Individual topic modules
371
- │ ├── run_api_docs/ # Run API documentation
372
- │ │ ├── index.ts # Run API tool handler
373
- │ │ ├── format.ts # Documentation formatter
374
- │ │ └── topics/ # Individual topic modules
375
- ├── xanoscript_docs/ # XanoScript language documentation
376
- ├── version.json
377
- │ │ ├── README.md
378
- │ │ ├── syntax.md
379
- │ │ └── ...
380
- └── templates/
381
- └── xanoscript-index.ts
382
- ├── dist/ # Compiled JavaScript output
367
+ │ ├── index.ts # Main MCP server implementation
368
+ │ ├── xanoscript.ts # XanoScript documentation logic
369
+ │ ├── xanoscript.test.ts # Tests for xanoscript module
370
+ │ ├── xanoscript-language-server.d.ts # TypeScript declarations
371
+ │ ├── meta_api_docs/ # Meta API documentation
372
+ │ │ ├── index.ts # API docs tool handler
373
+ │ │ ├── index.test.ts # Tests for index
374
+ ├── types.ts # Type definitions
375
+ │ │ ├── types.test.ts # Tests for types
376
+ │ │ ├── format.ts # Documentation formatter
377
+ │ │ ├── format.test.ts # Tests for formatter
378
+ │ └── topics/ # Individual topic modules
379
+ │ ├── run_api_docs/ # Run API documentation
380
+ │ │ ├── index.ts # Run API tool handler
381
+ │ │ ├── index.test.ts # Tests for index
382
+ │ │ ├── format.ts # Documentation formatter
383
+ │ ├── format.test.ts # Tests for formatter
384
+ └── topics/ # Individual topic modules
385
+ │ └── xanoscript_docs/ # XanoScript language documentation
386
+ │ ├── version.json
387
+ │ ├── README.md
388
+ │ ├── syntax.md
389
+ │ └── ...
390
+ ├── dist/ # Compiled JavaScript output
391
+ ├── vitest.config.ts # Test configuration
383
392
  ├── package.json
384
393
  └── tsconfig.json
385
394
  ```
@@ -392,6 +401,15 @@ xano-developer-mcp/
392
401
  | `@xano/xanoscript-language-server` | ^11.6.3 | XanoScript parser and validation |
393
402
  | `minimatch` | ^10.1.2 | Glob pattern matching for context-aware docs |
394
403
 
404
+ ### Dev Dependencies
405
+
406
+ | Package | Version | Purpose |
407
+ |---------|---------|---------|
408
+ | `typescript` | ^5.9.0 | TypeScript compiler |
409
+ | `vitest` | ^3.0.0 | Fast unit test framework |
410
+ | `@types/node` | ^22.0.0 | Node.js type definitions |
411
+ | `@types/minimatch` | ^5.1.2 | Minimatch type definitions |
412
+
395
413
  ## How It Works
396
414
 
397
415
  ```
@@ -444,6 +462,69 @@ Compiles TypeScript to JavaScript in the `dist/` directory.
444
462
  - Supports parameterized output (detail levels, schema inclusion)
445
463
  - Better for AI consumption due to context efficiency
446
464
 
465
+ ## Testing
466
+
467
+ The project uses [Vitest](https://vitest.dev/) as its test framework with comprehensive unit tests.
468
+
469
+ ### Running Tests
470
+
471
+ ```bash
472
+ # Run all tests
473
+ npm test
474
+
475
+ # Run tests in watch mode (re-runs on file changes)
476
+ npm run test:watch
477
+
478
+ # Run tests with coverage report
479
+ npm run test:coverage
480
+ ```
481
+
482
+ ### Test Coverage
483
+
484
+ | Module | Test File | Description |
485
+ |--------|-----------|-------------|
486
+ | `xanoscript.ts` | `xanoscript.test.ts` | Core XanoScript documentation logic including file path matching and quick reference extraction |
487
+ | `meta_api_docs/index.ts` | `meta_api_docs/index.test.ts` | Meta API documentation handler and topic management |
488
+ | `meta_api_docs/format.ts` | `meta_api_docs/format.test.ts` | Documentation formatting for endpoints, examples, and patterns |
489
+ | `meta_api_docs/types.ts` | `meta_api_docs/types.test.ts` | Type structure validation |
490
+ | `run_api_docs/index.ts` | `run_api_docs/index.test.ts` | Run API documentation handler |
491
+ | `run_api_docs/format.ts` | `run_api_docs/format.test.ts` | Run API formatting with correct base URL |
492
+
493
+ ### Test Structure
494
+
495
+ Tests are co-located with source files using the `.test.ts` suffix:
496
+
497
+ ```
498
+ src/
499
+ ├── xanoscript.ts
500
+ ├── xanoscript.test.ts # Tests for xanoscript.ts
501
+ ├── meta_api_docs/
502
+ │ ├── index.ts
503
+ │ ├── index.test.ts # Tests for index.ts
504
+ │ ├── format.ts
505
+ │ ├── format.test.ts # Tests for format.ts
506
+ │ └── ...
507
+ └── run_api_docs/
508
+ ├── index.ts
509
+ ├── index.test.ts # Tests for index.ts
510
+ └── ...
511
+ ```
512
+
513
+ ### Writing Tests
514
+
515
+ Tests use Vitest's API which is compatible with Jest:
516
+
517
+ ```typescript
518
+ import { describe, it, expect } from "vitest";
519
+ import { myFunction } from "./myModule.js";
520
+
521
+ describe("myFunction", () => {
522
+ it("should return expected result", () => {
523
+ expect(myFunction("input")).toBe("expected");
524
+ });
525
+ });
526
+ ```
527
+
447
528
  ## License
448
529
 
449
530
  See [LICENSE](LICENSE) for details.
package/dist/index.js CHANGED
@@ -5,11 +5,11 @@ import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSche
5
5
  import { readFileSync } from "fs";
6
6
  import { fileURLToPath } from "url";
7
7
  import { dirname, join } from "path";
8
- import { minimatch } from "minimatch";
9
8
  import { xanoscriptParser } from "@xano/xanoscript-language-server/parser/parser.js";
10
9
  import { getSchemeFromContent } from "@xano/xanoscript-language-server/utils.js";
11
10
  import { metaApiDocsToolDefinition, handleMetaApiDocs } from "./meta_api_docs/index.js";
12
11
  import { runApiDocsToolDefinition, handleRunApiDocs } from "./run_api_docs/index.js";
12
+ import { XANOSCRIPT_DOCS_V2, readXanoscriptDocsV2, getXanoscriptDocsVersion, getTopicDescriptions, } from "./xanoscript.js";
13
13
  const __filename = fileURLToPath(import.meta.url);
14
14
  const __dirname = dirname(__filename);
15
15
  const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
@@ -18,138 +18,6 @@ if (process.argv.includes("--version") || process.argv.includes("-v")) {
18
18
  console.log(SERVER_VERSION);
19
19
  process.exit(0);
20
20
  }
21
- const XANOSCRIPT_DOCS_V2 = {
22
- readme: {
23
- file: "README.md",
24
- applyTo: [],
25
- description: "XanoScript overview, workspace structure, and quick reference",
26
- },
27
- syntax: {
28
- file: "syntax.md",
29
- applyTo: ["**/*.xs"],
30
- description: "Expressions, operators, and filters for all XanoScript code",
31
- },
32
- types: {
33
- file: "types.md",
34
- applyTo: ["functions/**/*.xs", "apis/**/*.xs", "tools/**/*.xs", "agents/**/*.xs"],
35
- description: "Data types, input blocks, and validation",
36
- },
37
- tables: {
38
- file: "tables.md",
39
- applyTo: ["tables/*.xs"],
40
- description: "Database schema definitions with indexes and relationships",
41
- },
42
- functions: {
43
- file: "functions.md",
44
- applyTo: ["functions/**/*.xs"],
45
- description: "Reusable function stacks with inputs and responses",
46
- },
47
- apis: {
48
- file: "apis.md",
49
- applyTo: ["apis/**/*.xs"],
50
- description: "HTTP endpoint definitions with authentication and CRUD patterns",
51
- },
52
- tasks: {
53
- file: "tasks.md",
54
- applyTo: ["tasks/*.xs"],
55
- description: "Scheduled and cron jobs",
56
- },
57
- triggers: {
58
- file: "triggers.md",
59
- applyTo: ["triggers/**/*.xs"],
60
- description: "Event-driven handlers (table, realtime, workspace, agent, MCP)",
61
- },
62
- database: {
63
- file: "database.md",
64
- applyTo: ["functions/**/*.xs", "apis/**/*.xs", "tasks/*.xs", "tools/**/*.xs"],
65
- description: "All db.* operations: query, get, add, edit, patch, delete",
66
- },
67
- agents: {
68
- file: "agents.md",
69
- applyTo: ["agents/**/*.xs"],
70
- description: "AI agent configuration with LLM providers and tools",
71
- },
72
- tools: {
73
- file: "tools.md",
74
- applyTo: ["tools/**/*.xs"],
75
- description: "AI tools for agents and MCP servers",
76
- },
77
- "mcp-servers": {
78
- file: "mcp-servers.md",
79
- applyTo: ["mcp_servers/**/*.xs"],
80
- description: "MCP server definitions exposing tools",
81
- },
82
- testing: {
83
- file: "testing.md",
84
- applyTo: ["functions/**/*.xs", "apis/**/*.xs"],
85
- description: "Unit tests, mocks, and assertions",
86
- },
87
- integrations: {
88
- file: "integrations.md",
89
- applyTo: ["functions/**/*.xs", "apis/**/*.xs", "tasks/*.xs"],
90
- description: "Cloud storage, Redis, security, and external APIs",
91
- },
92
- frontend: {
93
- file: "frontend.md",
94
- applyTo: ["static/**/*"],
95
- description: "Static frontend development and deployment",
96
- },
97
- run: {
98
- file: "run.md",
99
- applyTo: ["run/**/*.xs"],
100
- description: "Run job and service configurations for the Xano Job Runner",
101
- },
102
- addons: {
103
- file: "addons.md",
104
- applyTo: ["addons/*.xs", "functions/**/*.xs", "apis/**/*.xs"],
105
- description: "Reusable subqueries for fetching related data",
106
- },
107
- debugging: {
108
- file: "debugging.md",
109
- applyTo: ["**/*.xs"],
110
- description: "Logging, inspecting, and debugging XanoScript execution",
111
- },
112
- performance: {
113
- file: "performance.md",
114
- applyTo: ["functions/**/*.xs", "apis/**/*.xs"],
115
- description: "Performance optimization best practices",
116
- },
117
- realtime: {
118
- file: "realtime.md",
119
- applyTo: ["functions/**/*.xs", "apis/**/*.xs", "triggers/**/*.xs"],
120
- description: "Real-time channels and events for push updates",
121
- },
122
- schema: {
123
- file: "schema.md",
124
- applyTo: ["functions/**/*.xs", "apis/**/*.xs"],
125
- description: "Runtime schema parsing and validation",
126
- },
127
- security: {
128
- file: "security.md",
129
- applyTo: ["functions/**/*.xs", "apis/**/*.xs"],
130
- description: "Security best practices for authentication and authorization",
131
- },
132
- streaming: {
133
- file: "streaming.md",
134
- applyTo: ["functions/**/*.xs", "apis/**/*.xs"],
135
- description: "Streaming data from files, requests, and responses",
136
- },
137
- middleware: {
138
- file: "middleware.md",
139
- applyTo: ["middleware/**/*.xs"],
140
- description: "Request/response interceptors for functions, queries, tasks, and tools",
141
- },
142
- branch: {
143
- file: "branch.md",
144
- applyTo: ["branch.xs"],
145
- description: "Branch-level settings: middleware, history retention, visual styling",
146
- },
147
- workspace: {
148
- file: "workspace.md",
149
- applyTo: ["workspace.xs"],
150
- description: "Workspace-level settings: environment variables, preferences, realtime",
151
- },
152
- };
153
21
  // =============================================================================
154
22
  // Path Resolution
155
23
  // =============================================================================
@@ -171,109 +39,6 @@ function getXanoscriptDocsPath() {
171
39
  }
172
40
  const XANOSCRIPT_DOCS_PATH = getXanoscriptDocsPath();
173
41
  // =============================================================================
174
- // Documentation Helpers
175
- // =============================================================================
176
- function getXanoscriptDocsVersion() {
177
- try {
178
- const versionFile = readFileSync(join(XANOSCRIPT_DOCS_PATH, "version.json"), "utf-8");
179
- return JSON.parse(versionFile).version || "unknown";
180
- }
181
- catch {
182
- return "unknown";
183
- }
184
- }
185
- // =============================================================================
186
- // XanoScript Documentation v2 Functions
187
- // =============================================================================
188
- /**
189
- * Get list of topics that apply to a given file path based on applyTo patterns
190
- */
191
- function getDocsForFilePath(filePath) {
192
- const matches = [];
193
- for (const [topic, config] of Object.entries(XANOSCRIPT_DOCS_V2)) {
194
- if (topic === "readme")
195
- continue; // Don't auto-include readme
196
- for (const pattern of config.applyTo) {
197
- if (minimatch(filePath, pattern)) {
198
- matches.push(topic);
199
- break;
200
- }
201
- }
202
- }
203
- // Always include syntax as foundation (if not already matched)
204
- if (!matches.includes("syntax")) {
205
- matches.unshift("syntax");
206
- }
207
- return matches;
208
- }
209
- /**
210
- * Extract just the Quick Reference section from a doc
211
- */
212
- function extractQuickReference(content, topic) {
213
- const lines = content.split("\n");
214
- const startIdx = lines.findIndex((l) => l.startsWith("## Quick Reference"));
215
- if (startIdx === -1) {
216
- // Fallback: return first 50 lines or up to first ## section
217
- const firstSection = lines.findIndex((l, i) => i > 0 && l.startsWith("## "));
218
- return lines.slice(0, firstSection > 0 ? firstSection : 50).join("\n");
219
- }
220
- // Find the next ## section after Quick Reference
221
- let endIdx = lines.findIndex((l, i) => i > startIdx && l.startsWith("## "));
222
- if (endIdx === -1)
223
- endIdx = lines.length;
224
- // Include topic header for context
225
- const header = `# ${topic}\n\n`;
226
- return header + lines.slice(startIdx, endIdx).join("\n");
227
- }
228
- /**
229
- * Read XanoScript documentation with new v2 structure
230
- */
231
- function readXanoscriptDocsV2(args) {
232
- const mode = args?.mode || "full";
233
- const version = getXanoscriptDocsVersion();
234
- try {
235
- // Default: return README
236
- if (!args?.topic && !args?.file_path) {
237
- const readme = readFileSync(join(XANOSCRIPT_DOCS_PATH, "README.md"), "utf-8");
238
- return `${readme}\n\n---\nDocumentation version: ${version}`;
239
- }
240
- // Context-aware: return docs matching file pattern
241
- if (args?.file_path) {
242
- const topics = getDocsForFilePath(args.file_path);
243
- if (topics.length === 0) {
244
- return `No documentation found for file pattern: ${args.file_path}\n\nAvailable topics: ${Object.keys(XANOSCRIPT_DOCS_V2).join(", ")}`;
245
- }
246
- const docs = topics.map((t) => {
247
- const config = XANOSCRIPT_DOCS_V2[t];
248
- const content = readFileSync(join(XANOSCRIPT_DOCS_PATH, config.file), "utf-8");
249
- return mode === "quick_reference"
250
- ? extractQuickReference(content, t)
251
- : content;
252
- });
253
- const header = `# XanoScript Documentation for: ${args.file_path}\n\nMatched topics: ${topics.join(", ")}\nMode: ${mode}\nVersion: ${version}\n\n---\n\n`;
254
- return header + docs.join("\n\n---\n\n");
255
- }
256
- // Topic-based: return specific doc
257
- if (args?.topic) {
258
- const config = XANOSCRIPT_DOCS_V2[args.topic];
259
- if (!config) {
260
- const availableTopics = Object.keys(XANOSCRIPT_DOCS_V2).join(", ");
261
- return `Error: Unknown topic "${args.topic}".\n\nAvailable topics: ${availableTopics}`;
262
- }
263
- const content = readFileSync(join(XANOSCRIPT_DOCS_PATH, config.file), "utf-8");
264
- const doc = mode === "quick_reference"
265
- ? extractQuickReference(content, args.topic)
266
- : content;
267
- return `${doc}\n\n---\nDocumentation version: ${version}`;
268
- }
269
- return "Error: Invalid parameters";
270
- }
271
- catch (error) {
272
- const errorMessage = error instanceof Error ? error.message : String(error);
273
- return `Error reading XanoScript documentation: ${errorMessage}`;
274
- }
275
- }
276
- // =============================================================================
277
42
  // MCP Server Setup
278
43
  // =============================================================================
279
44
  const server = new Server({
@@ -310,7 +75,7 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
310
75
  throw new Error(`Unknown topic: ${topic}. Available: ${Object.keys(XANOSCRIPT_DOCS_V2).join(", ")}`);
311
76
  }
312
77
  const content = readFileSync(join(XANOSCRIPT_DOCS_PATH, config.file), "utf-8");
313
- const version = getXanoscriptDocsVersion();
78
+ const version = getXanoscriptDocsVersion(XANOSCRIPT_DOCS_PATH);
314
79
  return {
315
80
  contents: [
316
81
  {
@@ -352,10 +117,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
352
117
  properties: {
353
118
  topic: {
354
119
  type: "string",
355
- description: "Documentation topic. Available: " +
356
- Object.entries(XANOSCRIPT_DOCS_V2)
357
- .map(([k, v]) => `${k} (${v.description.split(".")[0]})`)
358
- .join(", "),
120
+ description: "Documentation topic. Available: " + getTopicDescriptions(),
359
121
  },
360
122
  file_path: {
361
123
  type: "string",
@@ -462,7 +224,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
462
224
  }
463
225
  if (request.params.name === "xanoscript_docs") {
464
226
  const args = request.params.arguments;
465
- const documentation = readXanoscriptDocsV2(args);
227
+ const documentation = readXanoscriptDocsV2(XANOSCRIPT_DOCS_PATH, args);
466
228
  return {
467
229
  content: [
468
230
  {
@@ -2,4 +2,19 @@
2
2
  * Formatting utilities for API documentation output
3
3
  */
4
4
  import type { TopicDoc, DetailLevel } from "./types.js";
5
- export declare function formatDocumentation(doc: TopicDoc, detailLevel?: DetailLevel, includeSchemas?: boolean): string;
5
+ /**
6
+ * Configuration for documentation formatting
7
+ */
8
+ export interface FormatConfig {
9
+ baseUrlInfo: string;
10
+ toolName: string;
11
+ }
12
+ /**
13
+ * Default config for Meta API
14
+ */
15
+ export declare const META_API_CONFIG: FormatConfig;
16
+ /**
17
+ * Config for Run API
18
+ */
19
+ export declare const RUN_API_CONFIG: FormatConfig;
20
+ export declare function formatDocumentation(doc: TopicDoc, detailLevel?: DetailLevel, includeSchemas?: boolean, config?: FormatConfig): string;
@@ -2,14 +2,32 @@
2
2
  * Formatting utilities for API documentation output
3
3
  */
4
4
  /**
5
- * Base URL information included with any topic that has endpoints
5
+ * Default config for Meta API
6
6
  */
7
- const BASE_URL_INFO = `## Base URL
7
+ export const META_API_CONFIG = {
8
+ baseUrlInfo: `## Base URL
8
9
  \`\`\`
9
10
  https://<your-instance-subdomain>.xano.io/api:meta/<endpoint>
10
11
  \`\`\`
11
12
  Authorization: \`Bearer <your-access-token>\`
12
- `;
13
+ `,
14
+ toolName: "meta_api_docs",
15
+ };
16
+ /**
17
+ * Config for Run API
18
+ */
19
+ export const RUN_API_CONFIG = {
20
+ baseUrlInfo: `## Base URL
21
+ \`\`\`
22
+ https://app.dev.xano.com/api:run/<endpoint>
23
+ \`\`\`
24
+
25
+ **Important:** This is a fixed URL - NOT your Xano instance URL. All Run API requests go to this central endpoint.
26
+
27
+ Authorization: \`Bearer <your-access-token>\`
28
+ `,
29
+ toolName: "run_api_docs",
30
+ };
13
31
  function formatParameter(param) {
14
32
  const required = param.required ? " (required)" : "";
15
33
  const defaultVal = param.default !== undefined ? ` [default: ${param.default}]` : "";
@@ -109,7 +127,7 @@ function formatPattern(pattern) {
109
127
  }
110
128
  return lines.join("\n");
111
129
  }
112
- export function formatDocumentation(doc, detailLevel = "detailed", includeSchemas = true) {
130
+ export function formatDocumentation(doc, detailLevel = "detailed", includeSchemas = true, config = META_API_CONFIG) {
113
131
  const sections = [];
114
132
  // Header
115
133
  sections.push(`# ${doc.title}`);
@@ -124,7 +142,7 @@ export function formatDocumentation(doc, detailLevel = "detailed", includeSchema
124
142
  // Include base URL info if topic has endpoints or patterns (workflows)
125
143
  if (doc.endpoints?.length || doc.patterns?.length) {
126
144
  sections.push("");
127
- sections.push(BASE_URL_INFO);
145
+ sections.push(config.baseUrlInfo);
128
146
  }
129
147
  // Endpoints
130
148
  if (doc.endpoints?.length) {
@@ -165,7 +183,7 @@ export function formatDocumentation(doc, detailLevel = "detailed", includeSchema
165
183
  if (doc.related_topics?.length) {
166
184
  sections.push("");
167
185
  sections.push("## Related Topics");
168
- sections.push(`Use \`meta_api_docs\` with topic: ${doc.related_topics.join(", ")}`);
186
+ sections.push(`Use \`${config.toolName}\` with topic: ${doc.related_topics.join(", ")}`);
169
187
  }
170
188
  return sections.join("\n");
171
189
  }
@@ -0,0 +1 @@
1
+ export {};