@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
@@ -4,6 +4,7 @@
4
4
  * This module exports all documentation topics and provides
5
5
  * the meta_api_docs tool handler for the MCP server.
6
6
  */
7
+ import { z } from "zod";
7
8
  import type { TopicDoc, MetaApiDocsArgs } from "./types.js";
8
9
  /**
9
10
  * All available documentation topics
@@ -24,45 +25,16 @@ export declare function handleMetaApiDocs(args: MetaApiDocsArgs): string;
24
25
  /**
25
26
  * Tool definition for MCP server
26
27
  */
27
- export declare const metaApiDocsToolDefinition: {
28
- name: string;
29
- annotations: {
30
- readOnlyHint: boolean;
31
- destructiveHint: boolean;
32
- idempotentHint: boolean;
33
- openWorldHint: boolean;
34
- };
35
- description: string;
36
- inputSchema: {
37
- type: string;
38
- properties: {
39
- topic: {
40
- type: string;
41
- enum: string[];
42
- description: string;
43
- };
44
- detail_level: {
45
- type: string;
46
- enum: string[];
47
- default: string;
48
- description: string;
49
- };
50
- include_schemas: {
51
- type: string;
52
- default: boolean;
53
- description: string;
54
- };
55
- };
56
- required: string[];
57
- };
58
- outputSchema: {
59
- type: string;
60
- properties: {
61
- documentation: {
62
- type: string;
63
- description: string;
64
- };
65
- };
66
- required: string[];
67
- };
68
- };
28
+ export declare const metaApiDocsToolSpec: import("../tools/define_tool.js").BuiltTool<{
29
+ topic: z.ZodEnum<{
30
+ [x: string]: string;
31
+ }>;
32
+ detail_level: z.ZodOptional<z.ZodEnum<{
33
+ overview: "overview";
34
+ detailed: "detailed";
35
+ examples: "examples";
36
+ }>>;
37
+ include_schemas: z.ZodOptional<z.ZodBoolean>;
38
+ }, {
39
+ documentation: z.ZodString;
40
+ }>;
@@ -4,7 +4,9 @@
4
4
  * This module exports all documentation topics and provides
5
5
  * the meta_api_docs tool handler for the MCP server.
6
6
  */
7
+ import { z } from "zod";
7
8
  import { formatDocumentation } from "./format.js";
9
+ import { defineTool } from "../tools/define_tool.js";
8
10
  // Import all topic documentation
9
11
  import { startDoc } from "./topics/start.js";
10
12
  import { authenticationDoc } from "./topics/authentication.js";
@@ -75,14 +77,8 @@ export function handleMetaApiDocs(args) {
75
77
  /**
76
78
  * Tool definition for MCP server
77
79
  */
78
- export const metaApiDocsToolDefinition = {
79
- name: "meta_api_docs",
80
- annotations: {
81
- readOnlyHint: true,
82
- destructiveHint: false,
83
- idempotentHint: true,
84
- openWorldHint: false,
85
- },
80
+ export const metaApiDocsToolSpec = defineTool({
81
+ name: "xano_meta_api_docs",
86
82
  description: `Get documentation for Xano's Meta API. Use this to understand how to programmatically manage Xano workspaces, databases, APIs, functions, agents, and more.
87
83
 
88
84
  ## Topics
@@ -92,43 +88,35 @@ ${getTopicDescriptions()}
92
88
  - Start with "start" topic for overview and getting started
93
89
  - Use "workflows" for step-by-step guides
94
90
  - Use specific topics (workspace, table, api, etc.) for detailed endpoint docs`,
95
- inputSchema: {
96
- type: "object",
97
- properties: {
98
- topic: {
99
- type: "string",
100
- enum: getTopicNames(),
101
- description: "Documentation topic to retrieve. Start with 'start' for an overview of the Meta API. " +
102
- "Example: topic='workspace' for workspace management endpoints, topic='table' for database table operations.",
103
- },
104
- detail_level: {
105
- type: "string",
106
- enum: ["overview", "detailed", "examples"],
107
- default: "detailed",
108
- description: "Level of detail to return. " +
109
- "'overview' = brief summary of endpoints and their purpose. " +
110
- "'detailed' = full API reference with parameters, headers, and response formats. " +
111
- "'examples' = includes curl and fetch code examples for each endpoint. " +
112
- "Default: 'detailed'.",
113
- },
114
- include_schemas: {
115
- type: "boolean",
116
- default: true,
117
- description: "Include JSON schemas for request bodies and response payloads. " +
118
- "Useful for understanding the expected data format. Set to false to reduce response size. " +
119
- "Default: true.",
120
- },
121
- },
122
- required: ["topic"],
91
+ annotations: {
92
+ readOnlyHint: true,
93
+ destructiveHint: false,
94
+ idempotentHint: true,
95
+ openWorldHint: false,
123
96
  },
124
- outputSchema: {
125
- type: "object",
126
- properties: {
127
- documentation: {
128
- type: "string",
129
- description: "The Meta API documentation content for the requested topic.",
130
- },
131
- },
132
- required: ["documentation"],
97
+ inputShape: {
98
+ topic: z
99
+ .enum(getTopicNames())
100
+ .describe("Documentation topic to retrieve. Start with 'start' for an overview of the Meta API. " +
101
+ "Example: topic='workspace' for workspace management endpoints, topic='table' for database table operations."),
102
+ detail_level: z
103
+ .enum(["overview", "detailed", "examples"])
104
+ .optional()
105
+ .describe("Level of detail to return. " +
106
+ "'overview' = brief summary of endpoints and their purpose. " +
107
+ "'detailed' = full API reference with parameters, headers, and response formats. " +
108
+ "'examples' = includes curl and fetch code examples for each endpoint. " +
109
+ "Default: 'detailed'."),
110
+ include_schemas: z
111
+ .boolean()
112
+ .optional()
113
+ .describe("Include JSON schemas for request bodies and response payloads. " +
114
+ "Useful for understanding the expected data format. Set to false to reduce response size. " +
115
+ "Default: true."),
133
116
  },
134
- };
117
+ outputShape: {
118
+ documentation: z
119
+ .string()
120
+ .describe("The Meta API documentation content for the requested topic."),
121
+ },
122
+ });
@@ -4,10 +4,10 @@
4
4
  * Retrieves documentation for the Xano CLI.
5
5
  * Re-exports from the cli_docs module with ToolResult support.
6
6
  */
7
- import { cliDocsToolDefinition, topics, getTopicNames, getTopicDescriptions } from "../cli_docs/index.js";
7
+ import { cliDocsToolSpec, topics, getTopicNames, getTopicDescriptions } from "../cli_docs/index.js";
8
8
  import type { CliDocsArgs, DetailLevel, TopicDoc } from "../cli_docs/types.js";
9
9
  import type { ToolResult } from "./types.js";
10
- export { cliDocsToolDefinition, topics as cliTopics, getTopicNames as getCliTopicNames, getTopicDescriptions as getCliTopicDescriptions, };
10
+ export { cliDocsToolSpec, topics as cliTopics, getTopicNames as getCliTopicNames, getTopicDescriptions as getCliTopicDescriptions, };
11
11
  export type { CliDocsArgs, DetailLevel, TopicDoc };
12
12
  export interface CliDocsResult {
13
13
  documentation: string;
@@ -37,4 +37,3 @@ export declare function cliDocs(args: CliDocsArgs): CliDocsResult;
37
37
  * Get CLI documentation and return a ToolResult.
38
38
  */
39
39
  export declare function cliDocsTool(args: CliDocsArgs): ToolResult;
40
- export { cliDocsToolDefinition as toolDefinition };
@@ -4,11 +4,11 @@
4
4
  * Retrieves documentation for the Xano CLI.
5
5
  * Re-exports from the cli_docs module with ToolResult support.
6
6
  */
7
- import { handleCliDocs as _handleCliDocs, cliDocsToolDefinition, topics, getTopicNames, getTopicDescriptions, } from "../cli_docs/index.js";
7
+ import { handleCliDocs as _handleCliDocs, cliDocsToolSpec, topics, getTopicNames, getTopicDescriptions, } from "../cli_docs/index.js";
8
8
  // =============================================================================
9
9
  // Re-exports
10
10
  // =============================================================================
11
- export { cliDocsToolDefinition, topics as cliTopics, getTopicNames as getCliTopicNames, getTopicDescriptions as getCliTopicDescriptions, };
11
+ export { cliDocsToolSpec, topics as cliTopics, getTopicNames as getCliTopicNames, getTopicDescriptions as getCliTopicDescriptions, };
12
12
  // =============================================================================
13
13
  // Standalone Tool Function
14
14
  // =============================================================================
@@ -46,7 +46,7 @@ export function cliDocsTool(args) {
46
46
  if (!args?.topic) {
47
47
  return {
48
48
  success: false,
49
- error: "Error: 'topic' parameter is required. Use cli_docs with topic='start' for overview.",
49
+ error: "Error: 'topic' parameter is required. Use xano_cli_docs with topic='start' for overview.",
50
50
  };
51
51
  }
52
52
  try {
@@ -65,5 +65,3 @@ export function cliDocsTool(args) {
65
65
  };
66
66
  }
67
67
  }
68
- // Re-export tool definition for MCP
69
- export { cliDocsToolDefinition as toolDefinition };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Tool definition helper.
3
+ *
4
+ * Single source of truth: Zod input/output shapes carry parameter descriptions,
5
+ * enums, and validation rules. JSON Schema for the MCP protocol is derived
6
+ * from those shapes via `z.toJSONSchema`, so the wire-level schema and the
7
+ * runtime parser can never drift.
8
+ */
9
+ import { z } from "zod";
10
+ export type ZodRawShape = Record<string, z.ZodTypeAny>;
11
+ export interface ToolAnnotations {
12
+ readonly readOnlyHint?: boolean;
13
+ readonly destructiveHint?: boolean;
14
+ readonly idempotentHint?: boolean;
15
+ readonly openWorldHint?: boolean;
16
+ }
17
+ /**
18
+ * Branded JSON Schema type. Anything emitted by `defineTool` is guaranteed
19
+ * to have passed through `z.toJSONSchema` and had wire-incompatible keys
20
+ * (`$schema`, `additionalProperties`) stripped.
21
+ */
22
+ export type JsonSchema = Readonly<Record<string, unknown>> & {
23
+ readonly __jsonSchemaBrand: unique symbol;
24
+ };
25
+ export interface ToolDefinition {
26
+ readonly name: string;
27
+ readonly description: string;
28
+ readonly annotations: ToolAnnotations;
29
+ readonly inputSchema: JsonSchema;
30
+ readonly outputSchema: JsonSchema;
31
+ }
32
+ export interface ToolSpec<I extends ZodRawShape, O extends ZodRawShape> {
33
+ name: string;
34
+ description: string;
35
+ annotations: ToolAnnotations;
36
+ inputShape: I;
37
+ outputShape: O;
38
+ }
39
+ export interface BuiltTool<I extends ZodRawShape, O extends ZodRawShape> extends ToolSpec<I, O> {
40
+ readonly definition: ToolDefinition;
41
+ readonly inputParser: z.ZodObject<I>;
42
+ }
43
+ /**
44
+ * Build a tool from Zod shapes. Returns the spec plus a derived JSON Schema
45
+ * `definition` (for library consumers) and an `inputParser` (for safe parsing).
46
+ */
47
+ export declare function defineTool<I extends ZodRawShape, O extends ZodRawShape>(spec: ToolSpec<I, O>): BuiltTool<I, O>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Tool definition helper.
3
+ *
4
+ * Single source of truth: Zod input/output shapes carry parameter descriptions,
5
+ * enums, and validation rules. JSON Schema for the MCP protocol is derived
6
+ * from those shapes via `z.toJSONSchema`, so the wire-level schema and the
7
+ * runtime parser can never drift.
8
+ */
9
+ import { z } from "zod";
10
+ /**
11
+ * Strip keys that MCP clients/SDKs don't expect on tool schemas.
12
+ * - `$schema`: dialect URL added by zod 4 — not part of the MCP wire format.
13
+ * - `additionalProperties: false`: emitted by zod for `z.object`; we want
14
+ * the wire schema to remain forward-compatible (extra keys ignored by the
15
+ * parser anyway since `z.object` strips them).
16
+ */
17
+ function sanitizeJsonSchema(schema) {
18
+ const { $schema: _$schema, additionalProperties: _ap, ...rest } = schema;
19
+ return rest;
20
+ }
21
+ /**
22
+ * Build a tool from Zod shapes. Returns the spec plus a derived JSON Schema
23
+ * `definition` (for library consumers) and an `inputParser` (for safe parsing).
24
+ */
25
+ export function defineTool(spec) {
26
+ const inputParser = z.object(spec.inputShape);
27
+ const outputObj = z.object(spec.outputShape);
28
+ const definition = {
29
+ name: spec.name,
30
+ description: spec.description,
31
+ annotations: spec.annotations,
32
+ inputSchema: sanitizeJsonSchema(z.toJSONSchema(inputParser)),
33
+ outputSchema: sanitizeJsonSchema(z.toJSONSchema(outputObj)),
34
+ };
35
+ return { ...spec, definition, inputParser };
36
+ }
@@ -1,233 +1,100 @@
1
1
  /**
2
2
  * Xano Developer MCP Tools
3
3
  *
4
- * This module exports all tools for both MCP server usage and standalone library usage.
5
- *
6
- * @example MCP Server Usage (internal)
7
- * ```ts
8
- * import { toolDefinitions, handleTool } from './tools/index.js';
9
- *
10
- * // Register tools with MCP server
11
- * server.setRequestHandler(ListToolsRequestSchema, () => ({
12
- * tools: toolDefinitions
13
- * }));
14
- * ```
15
- *
16
- * @example Library Usage (external)
17
- * ```ts
18
- * import {
19
- * validateXanoscript,
20
- * xanoscriptDocs,
21
- * metaApiDocs,
22
- * cliDocs,
23
- * mcpVersion
24
- * } from '@xano/developer-mcp';
25
- *
26
- * // Use tools directly
27
- * const result = validateXanoscript({ code: 'return 1 + 1' });
28
- * const docs = xanoscriptDocs({ topic: 'syntax' });
29
- * ```
4
+ * Exports all tools for both MCP server usage and standalone library usage.
5
+ * Tool registration goes through `toolSpecs` and `handleTool` below — the
6
+ * `toolSpecs` map is the single source of truth for which tools exist and
7
+ * the dispatch table in `handleTool` is statically required to cover every
8
+ * key, so a new tool cannot be registered without being routed.
30
9
  */
31
- import { validateXanoscript, validateXanoscriptTool, validateXanoscriptToolDefinition, TYPE_ALIASES, RESERVED_VARIABLES, type ValidateXanoscriptArgs, type ValidationResult, type BatchValidationResult, type SingleFileValidationResult, type ParserDiagnostic } from "./validate_xanoscript.js";
32
- import { xanoscriptDocs, xanoscriptDocsTool, xanoscriptDocsToolDefinition, getXanoscriptDocsPath, setXanoscriptDocsPath, type XanoscriptDocsArgs, type XanoscriptDocsResult, type TopicDoc } from "./xanoscript_docs.js";
33
- import { mcpVersion, mcpVersionTool, mcpVersionToolDefinition, getServerVersion, setServerVersion, type McpVersionResult } from "./mcp_version.js";
34
- import { metaApiDocs, metaApiDocsTool, metaApiDocsToolDefinition, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions, type MetaApiDocsArgs, type MetaApiDocsResult } from "./meta_api_docs.js";
35
- import { cliDocs, cliDocsTool, cliDocsToolDefinition, cliTopics, getCliTopicNames, getCliTopicDescriptions, type CliDocsArgs, type CliDocsResult } from "./cli_docs.js";
10
+ import { validateXanoscript, validateXanoscriptTool, TYPE_ALIASES, RESERVED_VARIABLES, type ValidateXanoscriptArgs, type ValidationResult, type BatchValidationResult, type SingleFileValidationResult, type ParserDiagnostic } from "./validate_xanoscript.js";
11
+ import { xanoscriptDocs, xanoscriptDocsTool, getXanoscriptDocsPath, setXanoscriptDocsPath, type XanoscriptDocsArgs, type XanoscriptDocsResult, type TopicDoc } from "./xanoscript_docs.js";
12
+ import { mcpVersion, mcpVersionTool, getServerVersion, setServerVersion, type McpVersionResult } from "./mcp_version.js";
13
+ import { metaApiDocs, metaApiDocsTool, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions, type MetaApiDocsArgs, type MetaApiDocsResult } from "./meta_api_docs.js";
14
+ import { cliDocs, cliDocsTool, cliTopics, getCliTopicNames, getCliTopicDescriptions, type CliDocsArgs, type CliDocsResult } from "./cli_docs.js";
36
15
  import { type ToolResult, toMcpResponse } from "./types.js";
16
+ import { z } from "zod";
17
+ import type { BuiltTool } from "./define_tool.js";
37
18
  export { validateXanoscript, TYPE_ALIASES, RESERVED_VARIABLES, type ValidateXanoscriptArgs, type ValidationResult, type BatchValidationResult, type SingleFileValidationResult, type ParserDiagnostic, xanoscriptDocs, getXanoscriptDocsPath, setXanoscriptDocsPath, type XanoscriptDocsArgs, type XanoscriptDocsResult, type TopicDoc, mcpVersion, getServerVersion, setServerVersion, type McpVersionResult, metaApiDocs, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions, type MetaApiDocsArgs, type MetaApiDocsResult, cliDocs, cliTopics, getCliTopicNames, getCliTopicDescriptions, type CliDocsArgs, type CliDocsResult, type ToolResult, toMcpResponse, };
38
19
  export { validateXanoscriptTool, xanoscriptDocsTool, mcpVersionTool, metaApiDocsTool, cliDocsTool, };
39
- export { validateXanoscriptToolDefinition, xanoscriptDocsToolDefinition, mcpVersionToolDefinition, metaApiDocsToolDefinition, cliDocsToolDefinition, };
40
20
  /**
41
- * All tool definitions for MCP server registration
21
+ * Full tool specs (Zod shapes + derived JSON Schema). Use these to register
22
+ * tools with `McpServer.registerTool` — descriptions live in the shapes and
23
+ * the JSON Schema can never drift from the parser.
24
+ */
25
+ export declare const toolSpecs: {
26
+ readonly xano_validate_xanoscript: BuiltTool<{
27
+ code: z.ZodOptional<z.ZodString>;
28
+ file_path: z.ZodOptional<z.ZodString>;
29
+ file_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
+ directory: z.ZodOptional<z.ZodString>;
31
+ pattern: z.ZodOptional<z.ZodString>;
32
+ }, {
33
+ valid: z.ZodBoolean;
34
+ message: z.ZodString;
35
+ warnings: z.ZodOptional<z.ZodNumber>;
36
+ }>;
37
+ readonly xano_xanoscript_docs: BuiltTool<{
38
+ topic: z.ZodOptional<z.ZodEnum<{
39
+ [x: string]: string;
40
+ }>>;
41
+ file_path: z.ZodOptional<z.ZodString>;
42
+ mode: z.ZodOptional<z.ZodEnum<{
43
+ index: "index";
44
+ full: "full";
45
+ quick_reference: "quick_reference";
46
+ }>>;
47
+ tier: z.ZodOptional<z.ZodEnum<{
48
+ survival: "survival";
49
+ working: "working";
50
+ }>>;
51
+ max_tokens: z.ZodOptional<z.ZodNumber>;
52
+ exclude_topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ }, {
54
+ documentation: z.ZodOptional<z.ZodString>;
55
+ file_path: z.ZodOptional<z.ZodString>;
56
+ mode: z.ZodOptional<z.ZodString>;
57
+ tier: z.ZodOptional<z.ZodString>;
58
+ version: z.ZodOptional<z.ZodString>;
59
+ topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ }>;
61
+ readonly xano_version: BuiltTool<{}, {
62
+ version: z.ZodString;
63
+ }>;
64
+ readonly xano_meta_api_docs: BuiltTool<{
65
+ topic: z.ZodEnum<{
66
+ [x: string]: string;
67
+ }>;
68
+ detail_level: z.ZodOptional<z.ZodEnum<{
69
+ overview: "overview";
70
+ detailed: "detailed";
71
+ examples: "examples";
72
+ }>>;
73
+ include_schemas: z.ZodOptional<z.ZodBoolean>;
74
+ }, {
75
+ documentation: z.ZodString;
76
+ }>;
77
+ readonly xano_cli_docs: BuiltTool<{
78
+ topic: z.ZodEnum<{
79
+ [x: string]: string;
80
+ }>;
81
+ detail_level: z.ZodOptional<z.ZodEnum<{
82
+ overview: "overview";
83
+ detailed: "detailed";
84
+ examples: "examples";
85
+ }>>;
86
+ }, {
87
+ documentation: z.ZodString;
88
+ }>;
89
+ };
90
+ export type ToolName = keyof typeof toolSpecs;
91
+ /**
92
+ * Tool definitions array (derived from toolSpecs). Kept for callers that
93
+ * want a flat list to advertise.
42
94
  */
43
- export declare const toolDefinitions: ({
44
- name: string;
45
- annotations: {
46
- readOnlyHint: boolean;
47
- destructiveHint: boolean;
48
- idempotentHint: boolean;
49
- openWorldHint: boolean;
50
- };
51
- description: string;
52
- inputSchema: {
53
- type: string;
54
- properties: {
55
- code: {
56
- type: string;
57
- description: string;
58
- };
59
- file_path: {
60
- type: string;
61
- description: string;
62
- };
63
- file_paths: {
64
- type: string;
65
- items: {
66
- type: string;
67
- };
68
- description: string;
69
- };
70
- directory: {
71
- type: string;
72
- description: string;
73
- };
74
- pattern: {
75
- type: string;
76
- description: string;
77
- };
78
- };
79
- required: never[];
80
- };
81
- outputSchema: {
82
- type: string;
83
- properties: {
84
- valid: {
85
- type: string;
86
- description: string;
87
- };
88
- message: {
89
- type: string;
90
- description: string;
91
- };
92
- };
93
- required: string[];
94
- };
95
- } | {
96
- name: string;
97
- description: string;
98
- annotations: {
99
- readOnlyHint: boolean;
100
- destructiveHint: boolean;
101
- idempotentHint: boolean;
102
- openWorldHint: boolean;
103
- };
104
- inputSchema: {
105
- type: string;
106
- properties: {
107
- topic: {
108
- type: string;
109
- enum: string[];
110
- description: string;
111
- };
112
- file_path: {
113
- type: string;
114
- description: string;
115
- };
116
- mode: {
117
- type: string;
118
- enum: string[];
119
- description: string;
120
- };
121
- tier: {
122
- type: string;
123
- enum: string[];
124
- description: string;
125
- };
126
- max_tokens: {
127
- type: string;
128
- description: string;
129
- };
130
- exclude_topics: {
131
- type: string;
132
- items: {
133
- type: string;
134
- };
135
- description: string;
136
- };
137
- };
138
- required: never[];
139
- };
140
- outputSchema: {
141
- type: string;
142
- properties: {
143
- documentation: {
144
- type: string;
145
- description: string;
146
- };
147
- file_path: {
148
- type: string;
149
- description: string;
150
- };
151
- mode: {
152
- type: string;
153
- description: string;
154
- };
155
- version: {
156
- type: string;
157
- description: string;
158
- };
159
- topics: {
160
- type: string;
161
- items: {
162
- type: string;
163
- };
164
- description: string;
165
- };
166
- };
167
- };
168
- } | {
169
- name: string;
170
- annotations: {
171
- readOnlyHint: boolean;
172
- destructiveHint: boolean;
173
- idempotentHint: boolean;
174
- openWorldHint: boolean;
175
- };
176
- description: string;
177
- inputSchema: {
178
- type: string;
179
- properties: {};
180
- required: never[];
181
- };
182
- outputSchema: {
183
- type: string;
184
- properties: {
185
- version: {
186
- type: string;
187
- description: string;
188
- };
189
- };
190
- required: string[];
191
- };
192
- } | {
193
- name: string;
194
- annotations: {
195
- readOnlyHint: boolean;
196
- destructiveHint: boolean;
197
- idempotentHint: boolean;
198
- openWorldHint: boolean;
199
- };
200
- description: string;
201
- inputSchema: {
202
- type: string;
203
- properties: {
204
- topic: {
205
- type: string;
206
- enum: string[];
207
- description: string;
208
- };
209
- detail_level: {
210
- type: string;
211
- enum: string[];
212
- default: string;
213
- description: string;
214
- };
215
- };
216
- required: string[];
217
- };
218
- outputSchema: {
219
- type: string;
220
- properties: {
221
- documentation: {
222
- type: string;
223
- description: string;
224
- };
225
- };
226
- required: string[];
227
- };
228
- })[];
95
+ export declare const toolDefinitions: import("./define_tool.js").ToolDefinition[];
229
96
  /**
230
97
  * Handle a tool call by name and return the result.
231
- * This is used by the MCP server to dispatch tool calls.
98
+ * Async to allow future tools that perform I/O without breaking the signature.
232
99
  */
233
- export declare function handleTool(name: string, args: Record<string, unknown>): ToolResult;
100
+ export declare function handleTool(name: string, args: Record<string, unknown>): Promise<ToolResult>;