@smartbear/mcp 0.12.0 → 0.13.1

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 (89) hide show
  1. package/README.md +30 -6
  2. package/dist/bugsnag/client/api/CurrentUser.js +50 -26
  3. package/dist/bugsnag/client/api/Error.js +158 -57
  4. package/dist/bugsnag/client/api/Project.js +398 -243
  5. package/dist/bugsnag/client/api/api.js +4087 -3837
  6. package/dist/bugsnag/client/api/base.js +155 -173
  7. package/dist/bugsnag/client/api/configuration.js +28 -25
  8. package/dist/bugsnag/client/filters.js +11 -20
  9. package/dist/bugsnag/client.js +1398 -1277
  10. package/dist/bugsnag/input-schemas.js +39 -57
  11. package/dist/collaborator/client.js +335 -371
  12. package/dist/common/bugsnag.js +5 -3
  13. package/dist/common/cache.js +50 -57
  14. package/dist/common/client-registry.js +106 -119
  15. package/dist/common/info.js +7 -3
  16. package/dist/common/register-clients.js +0 -16
  17. package/dist/common/server.js +270 -228
  18. package/dist/common/tools.js +19 -0
  19. package/dist/common/transport-http.js +252 -343
  20. package/dist/common/transport-stdio.js +40 -37
  21. package/dist/common/zod-utils.js +20 -0
  22. package/dist/index.js +18 -23
  23. package/dist/package.json.js +11 -0
  24. package/dist/pactflow/client/ai.js +142 -169
  25. package/dist/pactflow/client/base.js +41 -51
  26. package/dist/pactflow/client/prompt-utils.js +93 -84
  27. package/dist/pactflow/client/prompts.js +95 -92
  28. package/dist/pactflow/client/tools.js +94 -83
  29. package/dist/pactflow/client/utils.js +60 -64
  30. package/dist/pactflow/client.js +399 -320
  31. package/dist/qmetry/client/api/client-api.js +43 -41
  32. package/dist/qmetry/client/api/error-handler.js +264 -310
  33. package/dist/qmetry/client/auto-resolve.js +78 -99
  34. package/dist/qmetry/client/automation.js +139 -162
  35. package/dist/qmetry/client/handlers.js +49 -46
  36. package/dist/qmetry/client/issues.js +133 -115
  37. package/dist/qmetry/client/project.js +153 -174
  38. package/dist/qmetry/client/requirement.js +82 -70
  39. package/dist/qmetry/client/testcase.js +240 -208
  40. package/dist/qmetry/client/testsuite.js +332 -293
  41. package/dist/qmetry/client/tools/automation-tools.js +291 -288
  42. package/dist/qmetry/client/tools/index.js +16 -13
  43. package/dist/qmetry/client/tools/issue-tools.js +534 -543
  44. package/dist/qmetry/client/tools/project-tools.js +635 -656
  45. package/dist/qmetry/client/tools/requirement-tools.js +525 -528
  46. package/dist/qmetry/client/tools/testcase-tools.js +773 -786
  47. package/dist/qmetry/client/tools/testsuite-tools.js +1069 -1083
  48. package/dist/qmetry/client/utils.js +8 -14
  49. package/dist/qmetry/client.js +111 -109
  50. package/dist/qmetry/config/constants.js +48 -44
  51. package/dist/qmetry/config/rest-endpoints.js +51 -48
  52. package/dist/qmetry/types/automation.js +7 -7
  53. package/dist/qmetry/types/common.js +763 -1049
  54. package/dist/qmetry/types/issues.js +26 -19
  55. package/dist/qmetry/types/project.js +32 -25
  56. package/dist/qmetry/types/requirements.js +26 -21
  57. package/dist/qmetry/types/testcase.js +55 -44
  58. package/dist/qmetry/types/testsuite.js +66 -52
  59. package/dist/reflect/client.js +284 -226
  60. package/dist/swagger/client/api.js +645 -662
  61. package/dist/swagger/client/configuration.js +31 -33
  62. package/dist/swagger/client/portal-types.js +204 -244
  63. package/dist/swagger/client/registry-types.js +62 -96
  64. package/dist/swagger/client/tools.js +148 -158
  65. package/dist/swagger/client/user-management-types.js +11 -22
  66. package/dist/swagger/client.js +143 -135
  67. package/dist/swagger/config-utils.js +10 -16
  68. package/dist/zephyr/client.js +43 -42
  69. package/dist/zephyr/common/api-client.js +35 -30
  70. package/dist/zephyr/common/auth-service.js +16 -13
  71. package/dist/zephyr/common/rest-api-schemas.js +3173 -5146
  72. package/dist/zephyr/tool/environment/get-environments.js +66 -66
  73. package/dist/zephyr/tool/priority/get-priorities.js +41 -41
  74. package/dist/zephyr/tool/project/get-project.js +37 -37
  75. package/dist/zephyr/tool/project/get-projects.js +46 -46
  76. package/dist/zephyr/tool/status/get-statuses.js +47 -47
  77. package/dist/zephyr/tool/test-case/get-test-case.js +37 -37
  78. package/dist/zephyr/tool/test-case/get-test-cases.js +62 -62
  79. package/dist/zephyr/tool/test-cycle/get-test-cycle.js +37 -37
  80. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +70 -70
  81. package/dist/zephyr/tool/test-execution/get-test-execution.js +37 -37
  82. package/dist/zephyr/tool/test-execution/get-test-executions.js +43 -43
  83. package/package.json +5 -5
  84. package/dist/bugsnag/client/api/index.js +0 -6
  85. package/dist/common/types.js +0 -6
  86. package/dist/qmetry/client/tools/types.js +0 -1
  87. package/dist/swagger/client/index.js +0 -6
  88. package/dist/tests/unit/bugsnag/utils/factories.js +0 -86
  89. package/dist/zephyr/tool/zephyr-tool.js +0 -1
@@ -1,239 +1,281 @@
1
- import { McpServer, ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { ZodAny, ZodArray, ZodBoolean, ZodDefault, ZodEnum, ZodIntersection, ZodLiteral, ZodNumber, ZodObject, ZodOptional, ZodRecord, ZodString, ZodUnion, } from "zod";
3
- import Bugsnag from "../common/bugsnag.js";
1
+ import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ZodObject, ZodIntersection, ZodOptional, ZodDefault, ZodRecord, ZodString, ZodNumber, ZodBoolean, ZodArray, ZodEnum, ZodLiteral, ZodUnion, ZodAny } from "zod";
3
+ import Bugsnag from "./bugsnag.js";
4
4
  import { CacheService } from "./cache.js";
5
- import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "./info.js";
6
- import { ToolError } from "./types.js";
7
- export class SmartBearMcpServer extends McpServer {
8
- cache;
9
- constructor() {
10
- super({
11
- name: MCP_SERVER_NAME,
12
- version: MCP_SERVER_VERSION,
13
- }, {
14
- capabilities: {
15
- resources: { listChanged: true }, // Server supports dynamic resource lists
16
- tools: { listChanged: true }, // Server supports dynamic tool lists
17
- sampling: {}, // Server supports sampling requests to Host
18
- elicitation: {}, // Server supports eliciting input from the user
19
- logging: {}, // Server supports logging messages
20
- prompts: {}, // Server supports sending prompts to Host
21
- },
22
- });
23
- this.cache = new CacheService();
24
- }
25
- getCache() {
26
- return this.cache;
27
- }
28
- addClient(client) {
29
- client.registerTools((params, cb) => {
30
- const toolName = `${client.toolPrefix}_${params.title.replace(/\s+/g, "_").toLowerCase()}`;
31
- const toolTitle = `${client.name}: ${params.title}`;
32
- return super.registerTool(toolName, {
33
- title: toolTitle,
34
- description: this.getDescription(params),
35
- inputSchema: this.getInputSchema(params),
36
- outputSchema: this.getOutputSchema(params),
37
- annotations: this.getAnnotations(toolTitle, params),
38
- }, async (args, extra) => {
39
- try {
40
- const result = await cb(args, extra);
41
- if (result) {
42
- this.validateCallbackResult(result, params);
43
- this.addStructuredContentAsText(result);
44
- }
45
- return result;
46
- }
47
- catch (e) {
48
- // ToolErrors should not be reported to BugSnag
49
- if (e instanceof ToolError) {
50
- return {
51
- isError: true,
52
- content: [
53
- {
54
- type: "text",
55
- text: `Error executing ${toolTitle}: ${e.message}`,
56
- },
57
- ],
58
- };
59
- }
60
- else {
61
- Bugsnag.notify(e, (event) => {
62
- event.addMetadata("app", { tool: toolName });
63
- event.unhandled = true;
64
- });
65
- }
66
- throw e;
67
- }
68
- });
69
- }, (params, options) => {
70
- return this.server.elicitInput(params, options);
71
- });
72
- if (client.registerResources) {
73
- client.registerResources((name, path, cb) => {
74
- const url = `${client.toolPrefix}://${name}/${path}`;
75
- return super.registerResource(name, new ResourceTemplate(url, {
76
- list: undefined,
77
- }), {}, async (url, variables, extra) => {
78
- try {
79
- return await cb(url, variables, extra);
80
- }
81
- catch (e) {
82
- Bugsnag.notify(e, (event) => {
83
- event.addMetadata("app", { resource: name, url: url });
84
- event.unhandled = true;
85
- });
86
- throw e;
5
+ import { MCP_SERVER_VERSION, MCP_SERVER_NAME } from "./info.js";
6
+ import { ToolError } from "./tools.js";
7
+ import { unwrapZodType } from "./zod-utils.js";
8
+ class SmartBearMcpServer extends McpServer {
9
+ cache;
10
+ constructor() {
11
+ super(
12
+ {
13
+ name: MCP_SERVER_NAME,
14
+ version: MCP_SERVER_VERSION
15
+ },
16
+ {
17
+ capabilities: {
18
+ resources: { listChanged: true },
19
+ // Server supports dynamic resource lists
20
+ tools: { listChanged: true },
21
+ // Server supports dynamic tool lists
22
+ logging: {},
23
+ // Server supports logging messages
24
+ prompts: {}
25
+ // Server supports sending prompts to Host
26
+ }
27
+ }
28
+ );
29
+ this.cache = new CacheService();
30
+ }
31
+ getCache() {
32
+ return this.cache;
33
+ }
34
+ async addClient(client) {
35
+ await client.registerTools(
36
+ (params, cb) => {
37
+ const toolName = `${client.toolPrefix}_${params.title.replace(/\s+/g, "_").toLowerCase()}`;
38
+ const toolTitle = `${client.name}: ${params.title}`;
39
+ return super.registerTool(
40
+ toolName,
41
+ {
42
+ title: toolTitle,
43
+ description: this.getDescription(params),
44
+ inputSchema: this.getInputSchema(params),
45
+ outputSchema: this.getOutputSchema(params),
46
+ annotations: this.getAnnotations(toolTitle, params)
47
+ },
48
+ async (args, extra) => {
49
+ try {
50
+ if (!client.isConfigured()) {
51
+ throw new ToolError(
52
+ `The tool is not configured - configuration options for ${client.name} are missing or invalid.`
53
+ );
54
+ }
55
+ const result = await cb(args, extra);
56
+ if (result) {
57
+ this.validateCallbackResult(result, params);
58
+ this.addStructuredContentAsText(result);
59
+ }
60
+ return result;
61
+ } catch (e) {
62
+ if (e instanceof ToolError) {
63
+ return {
64
+ isError: true,
65
+ content: [
66
+ {
67
+ type: "text",
68
+ text: `Error executing ${toolTitle}: ${e.message}`
87
69
  }
70
+ ]
71
+ };
72
+ } else {
73
+ Bugsnag.notify(e, (event) => {
74
+ event.addMetadata("app", { tool: toolName });
75
+ event.unhandled = true;
88
76
  });
89
- });
90
- }
91
- if (client.registerPrompts) {
92
- client.registerPrompts((name, config, cb) => {
93
- return super.registerPrompt(name, config, cb);
94
- });
95
- }
77
+ }
78
+ throw e;
79
+ }
80
+ }
81
+ );
82
+ },
83
+ (params, options) => {
84
+ return this.server.elicitInput(params, options);
85
+ }
86
+ );
87
+ if (client.registerResources) {
88
+ client.registerResources((name, path, cb) => {
89
+ const url = `${client.toolPrefix}://${name}/${path}`;
90
+ return super.registerResource(
91
+ name,
92
+ new ResourceTemplate(url, {
93
+ list: void 0
94
+ }),
95
+ {},
96
+ async (url2, variables, extra) => {
97
+ try {
98
+ return await cb(url2, variables, extra);
99
+ } catch (e) {
100
+ Bugsnag.notify(e, (event) => {
101
+ event.addMetadata("app", { resource: name, url: url2 });
102
+ event.unhandled = true;
103
+ });
104
+ throw e;
105
+ }
106
+ }
107
+ );
108
+ });
96
109
  }
97
- validateCallbackResult(result, params) {
98
- if (result.isError) {
99
- return;
100
- }
101
- if (params.outputSchema && !result.structuredContent) {
102
- throw new Error(`The result of the tool '${params.title}' must include 'structuredContent'`);
103
- }
110
+ if (client.registerPrompts) {
111
+ client.registerPrompts((name, config, cb) => {
112
+ return super.registerPrompt(name, config, cb);
113
+ });
104
114
  }
105
- addStructuredContentAsText(result) {
106
- if (result.structuredContent && !result.content?.length) {
107
- result.content = [
108
- {
109
- type: "text",
110
- text: JSON.stringify(result.structuredContent),
111
- },
112
- ];
113
- }
115
+ }
116
+ validateCallbackResult(result, params) {
117
+ if (result.isError) {
118
+ return;
114
119
  }
115
- getAnnotations(toolTitle, params) {
116
- const annotations = {
117
- title: toolTitle,
118
- readOnlyHint: params.readOnly ?? true,
119
- destructiveHint: params.destructive ?? false,
120
- idempotentHint: params.idempotent ?? true,
121
- openWorldHint: params.openWorld ?? false,
122
- };
123
- return annotations;
124
- }
125
- getInputSchema(params) {
126
- const args = {};
127
- for (const param of params.parameters ?? []) {
128
- args[param.name] = param.type;
129
- if (param.description) {
130
- args[param.name] = args[param.name].describe(param.description);
131
- }
132
- if (!param.required) {
133
- args[param.name] = args[param.name].optional();
134
- }
135
- }
136
- return { ...args, ...this.schemaToRawShape(params.inputSchema) };
120
+ if (params.outputSchema && !result.structuredContent) {
121
+ throw new Error(
122
+ `The result of the tool '${params.title}' must include 'structuredContent'`
123
+ );
137
124
  }
138
- schemaToRawShape(schema) {
139
- if (schema) {
140
- if (schema instanceof ZodObject) {
141
- return schema.shape;
142
- }
143
- if (schema instanceof ZodIntersection) {
144
- const leftShape = this.schemaToRawShape(schema._def.left);
145
- const rightShape = this.schemaToRawShape(schema._def.right);
146
- return { ...leftShape, ...rightShape };
147
- }
148
- }
149
- return undefined;
150
- }
151
- getOutputSchema(params) {
152
- return this.schemaToRawShape(params.outputSchema);
153
- }
154
- getDescription(params) {
155
- const { summary, useCases, examples, parameters, inputSchema, hints, outputDescription, } = params;
156
- let description = summary;
157
- // Parameters if available otherwise use inputSchema
158
- if ((parameters ?? []).length > 0) {
159
- description += `\n\n**Parameters:**\n${parameters
160
- ?.map((p) => `- ${p.name} (${this.getReadableTypeName(p.type)})${p.required ? " *required*" : ""}` +
161
- `${p.description ? `: ${p.description}` : ""}` +
162
- `${p.examples ? ` (e.g. ${p.examples.join(", ")})` : ""}` +
163
- `${p.constraints ? `\n - ${p.constraints.join("\n - ")}` : ""}`)
164
- .join("\n")}`;
125
+ }
126
+ addStructuredContentAsText(result) {
127
+ if (result.structuredContent && !result.content?.length) {
128
+ result.content = [
129
+ {
130
+ type: "text",
131
+ text: JSON.stringify(result.structuredContent)
165
132
  }
166
- if (inputSchema && inputSchema instanceof ZodObject) {
167
- description += "\n\n**Parameters:**\n";
168
- description += Object.keys(inputSchema.shape)
169
- .map((key) => this.formatParameterDescription(key, inputSchema.shape[key]))
170
- .join("\n");
171
- }
172
- if (outputDescription) {
173
- description += `\n\n**Output Description:** ${outputDescription}`;
174
- }
175
- // Use Cases
176
- if (useCases && useCases.length > 0) {
177
- description += `\n\n**Use Cases:** ${useCases.map((uc, i) => `${i + 1}. ${uc}`).join(" ")}`;
178
- }
179
- // Examples
180
- if (examples && examples.length > 0) {
181
- description +=
182
- `\n\n**Examples:**\n` +
183
- examples
184
- .map((ex, idx) => `${idx + 1}. ${ex.description}\n\`\`\`json\n${JSON.stringify(ex.parameters, null, 2)}\n\`\`\`${ex.expectedOutput ? `\nExpected Output: ${ex.expectedOutput}` : ""}`)
185
- .join("\n\n");
186
- }
187
- // Hints
188
- if (hints && hints.length > 0) {
189
- description += `\n\n**Hints:** ${hints.map((hint, i) => `${i + 1}. ${hint}`).join(" ")}`;
190
- }
191
- return description.trim();
133
+ ];
192
134
  }
193
- formatParameterDescription(key, field, description = null, isOptional = false, defaultValue = null) {
194
- description = description ?? (field.description || null);
195
- if (field instanceof ZodOptional) {
196
- field = field.unwrap();
197
- return this.formatParameterDescription(key, field, description, true, defaultValue);
198
- }
199
- if (field instanceof ZodDefault) {
200
- defaultValue = JSON.stringify(field._def.defaultValue());
201
- field = field.removeDefault();
202
- return this.formatParameterDescription(key, field, description, true, defaultValue);
203
- }
204
- return (`- ${key} (${this.getReadableTypeName(field)})` +
205
- `${isOptional ? "" : " *required*"}` +
206
- `${description ? `: ${description}` : ""}` +
207
- `${defaultValue ? ` (default: ${defaultValue})` : ""}`);
208
- }
209
- getReadableTypeName(zodType) {
210
- if (zodType instanceof ZodOptional) {
211
- return this.getReadableTypeName(zodType.unwrap());
212
- }
213
- if (zodType instanceof ZodDefault) {
214
- return this.getReadableTypeName(zodType.removeDefault());
215
- }
216
- if (zodType instanceof ZodRecord) {
217
- return `record<${this.getReadableTypeName(zodType.keySchema)}, ${this.getReadableTypeName(zodType.valueSchema)}>`;
218
- }
219
- if (zodType instanceof ZodString)
220
- return "string";
221
- if (zodType instanceof ZodNumber)
222
- return "number";
223
- if (zodType instanceof ZodBoolean)
224
- return "boolean";
225
- if (zodType instanceof ZodArray)
226
- return "array";
227
- if (zodType instanceof ZodObject)
228
- return "object";
229
- if (zodType instanceof ZodEnum)
230
- return "enum";
231
- if (zodType instanceof ZodLiteral)
232
- return "literal";
233
- if (zodType instanceof ZodUnion)
234
- return "union";
235
- if (zodType instanceof ZodAny)
236
- return "any";
237
- return "any";
135
+ }
136
+ getAnnotations(toolTitle, params) {
137
+ const annotations = {
138
+ title: toolTitle,
139
+ readOnlyHint: params.readOnly ?? true,
140
+ destructiveHint: params.destructive ?? false,
141
+ idempotentHint: params.idempotent ?? true,
142
+ openWorldHint: params.openWorld ?? false
143
+ };
144
+ return annotations;
145
+ }
146
+ getInputSchema(params) {
147
+ const args = {};
148
+ for (const param of params.parameters ?? []) {
149
+ args[param.name] = param.type;
150
+ if (param.description) {
151
+ args[param.name] = args[param.name].describe(param.description);
152
+ }
153
+ if (!param.required) {
154
+ args[param.name] = args[param.name].optional();
155
+ }
156
+ }
157
+ return { ...args, ...this.schemaToRawShape(params.inputSchema) };
158
+ }
159
+ schemaToRawShape(schema) {
160
+ if (schema) {
161
+ if (schema instanceof ZodObject) {
162
+ return schema.shape;
163
+ }
164
+ if (schema instanceof ZodIntersection) {
165
+ const leftShape = this.schemaToRawShape(
166
+ schema.def.left
167
+ );
168
+ const rightShape = this.schemaToRawShape(
169
+ schema.def.right
170
+ );
171
+ return { ...leftShape, ...rightShape };
172
+ }
173
+ }
174
+ return void 0;
175
+ }
176
+ getOutputSchema(params) {
177
+ return this.schemaToRawShape(params.outputSchema);
178
+ }
179
+ getDescription(params) {
180
+ const {
181
+ summary,
182
+ useCases,
183
+ examples,
184
+ parameters,
185
+ inputSchema,
186
+ hints,
187
+ outputDescription
188
+ } = params;
189
+ let description = summary;
190
+ if ((parameters ?? []).length > 0) {
191
+ description += `
192
+
193
+ **Parameters:**
194
+ ${parameters?.map(
195
+ (p) => `- ${p.name} (${this.getReadableTypeName(p.type)})${p.required ? " *required*" : ""}${p.description ? `: ${p.description}` : ""}${p.examples ? ` (e.g. ${p.examples.join(", ")})` : ""}${p.constraints ? `
196
+ - ${p.constraints.join("\n - ")}` : ""}`
197
+ ).join("\n")}`;
198
+ }
199
+ if (inputSchema && inputSchema instanceof ZodObject) {
200
+ description += "\n\n**Parameters:**\n";
201
+ description += Object.keys(inputSchema.shape).map(
202
+ (key) => this.formatParameterDescription(key, inputSchema.shape[key])
203
+ ).join("\n");
204
+ }
205
+ if (outputDescription) {
206
+ description += `
207
+
208
+ **Output Description:** ${outputDescription}`;
209
+ }
210
+ if (useCases && useCases.length > 0) {
211
+ description += `
212
+
213
+ **Use Cases:** ${useCases.map((uc, i) => `${i + 1}. ${uc}`).join(" ")}`;
214
+ }
215
+ if (examples && examples.length > 0) {
216
+ description += `
217
+
218
+ **Examples:**
219
+ ` + examples.map(
220
+ (ex, idx) => `${idx + 1}. ${ex.description}
221
+ \`\`\`json
222
+ ${JSON.stringify(ex.parameters, null, 2)}
223
+ \`\`\`${ex.expectedOutput ? `
224
+ Expected Output: ${ex.expectedOutput}` : ""}`
225
+ ).join("\n\n");
226
+ }
227
+ if (hints && hints.length > 0) {
228
+ description += `
229
+
230
+ **Hints:** ${hints.map((hint, i) => `${i + 1}. ${hint}`).join(" ")}`;
231
+ }
232
+ return description.trim();
233
+ }
234
+ formatParameterDescription(key, field, description = null, isOptional = false, defaultValue = null) {
235
+ description = description ?? (field.description || null);
236
+ if (field instanceof ZodOptional) {
237
+ field = field.unwrap();
238
+ return this.formatParameterDescription(
239
+ key,
240
+ field,
241
+ description,
242
+ true,
243
+ defaultValue
244
+ );
245
+ }
246
+ if (field instanceof ZodDefault) {
247
+ defaultValue = JSON.stringify(
248
+ field.def.defaultValue
249
+ );
250
+ field = field.unwrap();
251
+ return this.formatParameterDescription(
252
+ key,
253
+ field,
254
+ description,
255
+ true,
256
+ defaultValue
257
+ );
258
+ }
259
+ return `- ${key} (${this.getReadableTypeName(field)})${isOptional ? "" : " *required*"}${description ? `: ${description}` : ""}${defaultValue ? ` (default: ${defaultValue})` : ""}`;
260
+ }
261
+ getReadableTypeName(zodType) {
262
+ zodType = unwrapZodType(zodType);
263
+ if (zodType instanceof ZodRecord) {
264
+ const record = zodType;
265
+ return `record<${this.getReadableTypeName(record.def.keyType)}, ${this.getReadableTypeName(record.def.valueType)}>`;
238
266
  }
267
+ if (zodType instanceof ZodString) return "string";
268
+ if (zodType instanceof ZodNumber) return "number";
269
+ if (zodType instanceof ZodBoolean) return "boolean";
270
+ if (zodType instanceof ZodArray) return "array";
271
+ if (zodType instanceof ZodObject) return "object";
272
+ if (zodType instanceof ZodEnum) return "enum";
273
+ if (zodType instanceof ZodLiteral) return "literal";
274
+ if (zodType instanceof ZodUnion) return "union";
275
+ if (zodType instanceof ZodAny) return "any";
276
+ return "any";
277
+ }
239
278
  }
279
+ export {
280
+ SmartBearMcpServer
281
+ };
@@ -0,0 +1,19 @@
1
+ class ToolError extends Error {
2
+ // can be used to set misc properties like response status code, etc.
3
+ metadata;
4
+ constructor(cause, options, metadata) {
5
+ super(cause, options);
6
+ this.metadata = metadata;
7
+ Object.setPrototypeOf(this, ToolError.prototype);
8
+ }
9
+ }
10
+ class Tool {
11
+ client;
12
+ constructor(client) {
13
+ this.client = client;
14
+ }
15
+ }
16
+ export {
17
+ Tool,
18
+ ToolError
19
+ };