taurusdb-mcp 0.1.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 (44) hide show
  1. package/README.md +32 -0
  2. package/dist/commands/init.d.ts +1 -0
  3. package/dist/commands/init.js +195 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +22 -0
  6. package/dist/server.d.ts +12 -0
  7. package/dist/server.js +60 -0
  8. package/dist/tools/common/input.d.ts +50 -0
  9. package/dist/tools/common/input.js +168 -0
  10. package/dist/tools/common/public-formatters.d.ts +344 -0
  11. package/dist/tools/common/public-formatters.js +348 -0
  12. package/dist/tools/common.d.ts +2 -0
  13. package/dist/tools/common.js +2 -0
  14. package/dist/tools/discovery.d.ts +5 -0
  15. package/dist/tools/discovery.js +113 -0
  16. package/dist/tools/error-handling.d.ts +10 -0
  17. package/dist/tools/error-handling.js +122 -0
  18. package/dist/tools/ping.d.ts +4 -0
  19. package/dist/tools/ping.js +13 -0
  20. package/dist/tools/processlist.d.ts +2 -0
  21. package/dist/tools/processlist.js +121 -0
  22. package/dist/tools/query.d.ts +4 -0
  23. package/dist/tools/query.js +224 -0
  24. package/dist/tools/registry.d.ts +22 -0
  25. package/dist/tools/registry.js +106 -0
  26. package/dist/tools/taurus/capability.d.ts +3 -0
  27. package/dist/tools/taurus/capability.js +66 -0
  28. package/dist/tools/taurus/cloud-context.d.ts +4 -0
  29. package/dist/tools/taurus/cloud-context.js +209 -0
  30. package/dist/tools/taurus/cloud-instances.d.ts +2 -0
  31. package/dist/tools/taurus/cloud-instances.js +73 -0
  32. package/dist/tools/taurus/diagnostics.d.ts +9 -0
  33. package/dist/tools/taurus/diagnostics.js +323 -0
  34. package/dist/tools/taurus/explain.d.ts +2 -0
  35. package/dist/tools/taurus/explain.js +69 -0
  36. package/dist/tools/taurus/flashback.d.ts +2 -0
  37. package/dist/tools/taurus/flashback.js +101 -0
  38. package/dist/tools/taurus/recycle-bin.d.ts +3 -0
  39. package/dist/tools/taurus/recycle-bin.js +148 -0
  40. package/dist/utils/formatter.d.ts +5 -0
  41. package/dist/utils/formatter.js +8 -0
  42. package/dist/version.d.ts +1 -0
  43. package/dist/version.js +1 -0
  44. package/package.json +40 -0
@@ -0,0 +1,106 @@
1
+ import { generateTaskId, logger, withTaskContext, } from "taurusdb-core";
2
+ import { executeReadonlySqlTool, executeSqlTool, explainSqlTool, } from "./query.js";
3
+ import { describeTableTool, listDatabasesTool, listTablesTool, } from "./discovery.js";
4
+ import { showProcesslistTool } from "./processlist.js";
5
+ import { pingTool } from "./ping.js";
6
+ import { getKernelInfoTool, listTaurusFeaturesTool } from "./taurus/capability.js";
7
+ import { selectCloudTaurusInstanceTool, setCloudAccessKeysTool, setCloudRegionTool, } from "./taurus/cloud-context.js";
8
+ import { listCloudTaurusInstancesTool } from "./taurus/cloud-instances.js";
9
+ import { diagnosticToolDefinitions } from "./taurus/diagnostics.js";
10
+ import { explainSqlEnhancedTool } from "./taurus/explain.js";
11
+ import { flashbackQueryTool } from "./taurus/flashback.js";
12
+ import { listRecycleBinTool, restoreRecycleBinTableTool } from "./taurus/recycle-bin.js";
13
+ import { ErrorCode, formatError, toMcpToolResult, } from "../utils/formatter.js";
14
+ function formatUnhandledToolError(error, taskId) {
15
+ const message = error instanceof Error ? error.message : String(error);
16
+ const response = formatError({
17
+ code: ErrorCode.CONNECTION_FAILED,
18
+ message,
19
+ summary: "Tool execution failed unexpectedly.",
20
+ metadata: { task_id: taskId },
21
+ retryable: false,
22
+ });
23
+ return toMcpToolResult(response);
24
+ }
25
+ function registerOneTool(server, tool, deps) {
26
+ const registrar = server;
27
+ const wrappedHandler = async (rawInput) => {
28
+ const taskId = generateTaskId();
29
+ return withTaskContext(taskId, async () => {
30
+ const startedAt = Date.now();
31
+ logger.info({ tool: tool.name }, "Tool invocation started");
32
+ try {
33
+ const response = await tool.handler(rawInput, deps, { taskId });
34
+ logger.info({ tool: tool.name, ok: response.ok, durationMs: Date.now() - startedAt }, "Tool invocation finished");
35
+ return toMcpToolResult(response);
36
+ }
37
+ catch (error) {
38
+ logger.error({ err: error, tool: tool.name }, "Tool invocation failed with unhandled error");
39
+ return formatUnhandledToolError(error, taskId);
40
+ }
41
+ });
42
+ };
43
+ if (typeof registrar.registerTool === "function") {
44
+ registrar.registerTool(tool.name, {
45
+ description: tool.description,
46
+ inputSchema: tool.inputSchema,
47
+ }, wrappedHandler);
48
+ return;
49
+ }
50
+ if (typeof registrar.tool === "function") {
51
+ registrar.tool(tool.name, tool.description, tool.inputSchema, wrappedHandler);
52
+ return;
53
+ }
54
+ throw new Error("Unsupported MCP SDK version: expected `tool` or `registerTool` on McpServer.");
55
+ }
56
+ export const commonToolDefinitions = [
57
+ pingTool,
58
+ listDatabasesTool,
59
+ listTablesTool,
60
+ describeTableTool,
61
+ showProcesslistTool,
62
+ executeReadonlySqlTool,
63
+ explainSqlTool,
64
+ executeSqlTool,
65
+ ];
66
+ export const capabilityToolDefinitions = [
67
+ getKernelInfoTool,
68
+ listTaurusFeaturesTool,
69
+ setCloudRegionTool,
70
+ setCloudAccessKeysTool,
71
+ listCloudTaurusInstancesTool,
72
+ selectCloudTaurusInstanceTool,
73
+ ];
74
+ function buildDefaultToolDefinitions(_config, probe) {
75
+ const tools = [
76
+ ...commonToolDefinitions,
77
+ ...capabilityToolDefinitions,
78
+ ...diagnosticToolDefinitions,
79
+ ];
80
+ if (probe?.features) {
81
+ if (probe.features.ndp_pushdown.available || probe.features.parallel_query.available) {
82
+ tools.push(explainSqlEnhancedTool);
83
+ }
84
+ if (probe.features.flashback_query.available) {
85
+ tools.push(flashbackQueryTool);
86
+ }
87
+ if (probe.features.recycle_bin.available) {
88
+ tools.push(listRecycleBinTool, restoreRecycleBinTableTool);
89
+ }
90
+ }
91
+ return tools;
92
+ }
93
+ function isToolDefinitionArray(value) {
94
+ return Array.isArray(value);
95
+ }
96
+ export function registerTools(server, deps, config, probeOrTools, maybeTools) {
97
+ const probe = isToolDefinitionArray(probeOrTools) ? undefined : probeOrTools;
98
+ const tools = maybeTools
99
+ ?? (isToolDefinitionArray(probeOrTools) ? probeOrTools : buildDefaultToolDefinitions(config, probe));
100
+ for (const tool of tools) {
101
+ if (tool.exposeWhen && !tool.exposeWhen(config)) {
102
+ continue;
103
+ }
104
+ registerOneTool(server, tool, deps);
105
+ }
106
+ }
@@ -0,0 +1,3 @@
1
+ import type { ToolDefinition } from "../registry.js";
2
+ export declare const getKernelInfoTool: ToolDefinition;
3
+ export declare const listTaurusFeaturesTool: ToolDefinition;
@@ -0,0 +1,66 @@
1
+ import { formatSuccess } from "../../utils/formatter.js";
2
+ import { formatToolError } from "../error-handling.js";
3
+ import { contextInputShape, metadata, resolveContext, toPublicFeatureMatrix, toPublicKernelInfo, } from "../common.js";
4
+ export const getKernelInfoTool = {
5
+ name: "get_kernel_info",
6
+ description: "Detect whether the selected datasource is TaurusDB and return kernel metadata.",
7
+ inputSchema: {
8
+ datasource: contextInputShape.datasource,
9
+ },
10
+ async handler(input, deps, context) {
11
+ try {
12
+ const ctx = await resolveContext(input, deps, context, true);
13
+ const kernel = await deps.engine.getKernelInfo(ctx);
14
+ return formatSuccess({
15
+ datasource: ctx.datasource,
16
+ kernel: toPublicKernelInfo(kernel),
17
+ }, {
18
+ summary: kernel.isTaurusDB
19
+ ? `TaurusDB instance detected on datasource ${ctx.datasource}.`
20
+ : `Datasource ${ctx.datasource} does not appear to be TaurusDB.`,
21
+ metadata: metadata(context.taskId),
22
+ });
23
+ }
24
+ catch (error) {
25
+ return formatToolError(error, {
26
+ action: "get_kernel_info",
27
+ metadata: metadata(context.taskId),
28
+ });
29
+ }
30
+ },
31
+ };
32
+ export const listTaurusFeaturesTool = {
33
+ name: "list_taurus_features",
34
+ description: "Return the TaurusDB kernel info and feature matrix for the selected datasource. Works on non-TaurusDB instances by returning unavailable features.",
35
+ inputSchema: {
36
+ datasource: contextInputShape.datasource,
37
+ },
38
+ async handler(input, deps, context) {
39
+ try {
40
+ const ctx = await resolveContext(input, deps, context, true);
41
+ const [kernel, features] = await Promise.all([
42
+ deps.engine.getKernelInfo(ctx),
43
+ deps.engine.listFeatures(ctx),
44
+ ]);
45
+ const publicFeatures = toPublicFeatureMatrix(features);
46
+ const availableCount = Object.values(publicFeatures).filter((feature) => feature.available).length;
47
+ const totalCount = Object.keys(publicFeatures).length;
48
+ return formatSuccess({
49
+ datasource: ctx.datasource,
50
+ kernel: toPublicKernelInfo(kernel),
51
+ features: publicFeatures,
52
+ }, {
53
+ summary: kernel.isTaurusDB
54
+ ? `TaurusDB instance detected. Kernel version ${kernel.kernelVersion ?? "unknown"}, ${availableCount} of ${totalCount} features available.`
55
+ : `Datasource ${ctx.datasource} is not TaurusDB. Returning an unavailable feature matrix for compatibility discovery.`,
56
+ metadata: metadata(context.taskId),
57
+ });
58
+ }
59
+ catch (error) {
60
+ return formatToolError(error, {
61
+ action: "list_taurus_features",
62
+ metadata: metadata(context.taskId),
63
+ });
64
+ }
65
+ },
66
+ };
@@ -0,0 +1,4 @@
1
+ import type { ToolDefinition } from "../registry.js";
2
+ export declare const setCloudRegionTool: ToolDefinition;
3
+ export declare const setCloudAccessKeysTool: ToolDefinition;
4
+ export declare const selectCloudTaurusInstanceTool: ToolDefinition;
@@ -0,0 +1,209 @@
1
+ import { createCloudTaurusInstanceClient, TaurusDBEngine, } from "taurusdb-core";
2
+ import { z } from "zod";
3
+ import { formatSuccess } from "../../utils/formatter.js";
4
+ import { formatToolError, ToolInputError } from "../error-handling.js";
5
+ import { metadata } from "../common.js";
6
+ function buildHuaweiCloudEndpoint(service, region, domainSuffix) {
7
+ return `https://${service}.${region}.${domainSuffix}`;
8
+ }
9
+ function clearCloudSelection(deps) {
10
+ deps.config.cloud.projectId = undefined;
11
+ deps.config.cloud.instanceId = undefined;
12
+ deps.config.cloud.nodeId = undefined;
13
+ deps.config.slowSqlSource.taurusApi.projectId = undefined;
14
+ deps.config.slowSqlSource.taurusApi.instanceId = undefined;
15
+ deps.config.slowSqlSource.taurusApi.nodeId = undefined;
16
+ deps.config.slowSqlSource.das.projectId = undefined;
17
+ deps.config.slowSqlSource.das.instanceId = undefined;
18
+ deps.config.metricsSource.ces.projectId = undefined;
19
+ deps.config.metricsSource.ces.instanceId = undefined;
20
+ deps.config.metricsSource.ces.nodeId = undefined;
21
+ deps.profileLoader.clearAllRuntimeTargets();
22
+ }
23
+ async function reloadEngine(deps) {
24
+ const nextEngine = await TaurusDBEngine.create({
25
+ config: deps.config,
26
+ profileLoader: deps.profileLoader,
27
+ });
28
+ const previousEngine = deps.engine;
29
+ deps.engine = nextEngine;
30
+ if (previousEngine?.close) {
31
+ await previousEngine.close();
32
+ }
33
+ }
34
+ async function resolveBindingDatasource(deps, explicit) {
35
+ const trimmed = typeof explicit === "string" ? explicit.trim() : "";
36
+ if (trimmed) {
37
+ return trimmed;
38
+ }
39
+ return deps.engine.getDefaultDataSource();
40
+ }
41
+ function selectInstanceAddress(input) {
42
+ return input.publicIps[0] ?? input.privateIps[0] ?? input.hostnames[0];
43
+ }
44
+ function normalizePort(port) {
45
+ if (typeof port === "number" && Number.isFinite(port)) {
46
+ return port;
47
+ }
48
+ if (typeof port === "string" && /^\d+$/.test(port.trim())) {
49
+ return Number.parseInt(port, 10);
50
+ }
51
+ return undefined;
52
+ }
53
+ export const setCloudRegionTool = {
54
+ name: "set_cloud_region",
55
+ description: "Update the active Huawei Cloud region for the current MCP session and reset any stale cloud project or instance selections.",
56
+ inputSchema: {
57
+ region: z.string().trim().min(1).describe("Huawei Cloud region id, for example cn-north-4."),
58
+ },
59
+ async handler(input, deps, context) {
60
+ try {
61
+ const region = typeof input.region === "string" ? input.region.trim() : "";
62
+ if (!region) {
63
+ throw new ToolInputError("region is required.");
64
+ }
65
+ const domainSuffix = deps.config.cloud.domainSuffix ?? "myhuaweicloud.com";
66
+ deps.config.cloud.region = region;
67
+ deps.config.cloud.apiEndpoint = buildHuaweiCloudEndpoint("gaussdb", region, domainSuffix);
68
+ deps.config.cloud.iamEndpoint = buildHuaweiCloudEndpoint("iam", region, domainSuffix);
69
+ deps.config.slowSqlSource.taurusApi.endpoint = buildHuaweiCloudEndpoint("gaussdb", region, domainSuffix);
70
+ deps.config.slowSqlSource.das.endpoint = buildHuaweiCloudEndpoint("das", region, domainSuffix);
71
+ deps.config.metricsSource.ces.endpoint = buildHuaweiCloudEndpoint("ces", region, domainSuffix);
72
+ clearCloudSelection(deps);
73
+ await reloadEngine(deps);
74
+ return formatSuccess({
75
+ region,
76
+ api_endpoint: deps.config.cloud.apiEndpoint,
77
+ iam_endpoint: deps.config.cloud.iamEndpoint,
78
+ }, {
79
+ summary: `Cloud region switched to ${region}.`,
80
+ metadata: metadata(context.taskId),
81
+ });
82
+ }
83
+ catch (error) {
84
+ return formatToolError(error, {
85
+ action: "set_cloud_region",
86
+ metadata: metadata(context.taskId),
87
+ });
88
+ }
89
+ },
90
+ };
91
+ export const setCloudAccessKeysTool = {
92
+ name: "set_cloud_access_keys",
93
+ description: "Update the active Huawei Cloud AK/SK for the current MCP session and clear stale token or instance bindings.",
94
+ inputSchema: {
95
+ access_key_id: z.string().trim().min(1).describe("Huawei Cloud access key id."),
96
+ secret_access_key: z.string().trim().min(1).describe("Huawei Cloud secret access key."),
97
+ security_token: z.string().trim().min(1).optional().describe("Optional temporary security token when using temporary AK/SK."),
98
+ },
99
+ async handler(input, deps, context) {
100
+ try {
101
+ const accessKeyId = typeof input.access_key_id === "string" ? input.access_key_id.trim() : "";
102
+ const secretAccessKey = typeof input.secret_access_key === "string" ? input.secret_access_key.trim() : "";
103
+ const securityToken = typeof input.security_token === "string" ? input.security_token.trim() : undefined;
104
+ if (!accessKeyId || !secretAccessKey) {
105
+ throw new ToolInputError("access_key_id and secret_access_key are required.");
106
+ }
107
+ deps.config.cloud.accessKeyId = accessKeyId;
108
+ deps.config.cloud.secretAccessKey = secretAccessKey;
109
+ deps.config.cloud.securityToken = securityToken;
110
+ deps.config.cloud.authToken = undefined;
111
+ deps.config.slowSqlSource.taurusApi.authToken = undefined;
112
+ deps.config.slowSqlSource.das.authToken = undefined;
113
+ deps.config.metricsSource.ces.authToken = undefined;
114
+ clearCloudSelection(deps);
115
+ await reloadEngine(deps);
116
+ return formatSuccess({
117
+ access_key_id_suffix: accessKeyId.slice(-4),
118
+ uses_security_token: Boolean(securityToken),
119
+ }, {
120
+ summary: "Cloud access keys updated for the current session.",
121
+ metadata: metadata(context.taskId),
122
+ });
123
+ }
124
+ catch (error) {
125
+ return formatToolError(error, {
126
+ action: "set_cloud_access_keys",
127
+ metadata: metadata(context.taskId),
128
+ });
129
+ }
130
+ },
131
+ };
132
+ export const selectCloudTaurusInstanceTool = {
133
+ name: "select_cloud_taurus_instance",
134
+ description: "Select the default TaurusDB cloud instance for the current session so diagnostics can reuse its instance id and default node id.",
135
+ inputSchema: {
136
+ instance_id: z.string().trim().min(1).describe("Exact TaurusDB instance id to bind into the current session."),
137
+ datasource: z
138
+ .string()
139
+ .trim()
140
+ .min(1)
141
+ .optional()
142
+ .describe("Optional datasource template to bind to this cloud instance. Defaults to the current default datasource."),
143
+ },
144
+ async handler(input, deps, context) {
145
+ try {
146
+ const instanceId = typeof input.instance_id === "string" ? input.instance_id.trim() : "";
147
+ if (!instanceId) {
148
+ throw new ToolInputError("instance_id is required.");
149
+ }
150
+ const client = createCloudTaurusInstanceClient(deps.config);
151
+ if (!client) {
152
+ throw new ToolInputError("Cloud instance selection is not configured. Set cloud region and either auth token or AK/SK first.");
153
+ }
154
+ const [items, projectId] = await Promise.all([
155
+ client.list({ id: instanceId, limit: 10 }),
156
+ client.getProjectId(),
157
+ ]);
158
+ const matched = items.find((item) => item.id === instanceId);
159
+ if (!matched) {
160
+ throw new ToolInputError(`No TaurusDB cloud instance matched id ${instanceId}.`);
161
+ }
162
+ deps.config.cloud.projectId = projectId;
163
+ deps.config.cloud.instanceId = matched.id;
164
+ deps.config.cloud.nodeId = matched.primaryNodeId;
165
+ deps.config.slowSqlSource.taurusApi.projectId = projectId;
166
+ deps.config.slowSqlSource.taurusApi.instanceId = matched.id;
167
+ deps.config.slowSqlSource.taurusApi.nodeId = matched.primaryNodeId;
168
+ deps.config.slowSqlSource.das.projectId = projectId;
169
+ deps.config.slowSqlSource.das.instanceId = matched.id;
170
+ deps.config.metricsSource.ces.projectId = projectId;
171
+ deps.config.metricsSource.ces.instanceId = matched.id;
172
+ deps.config.metricsSource.ces.nodeId = matched.primaryNodeId;
173
+ const boundDatasource = await resolveBindingDatasource(deps, typeof input.datasource === "string" ? input.datasource : undefined);
174
+ const selectedHost = selectInstanceAddress(matched);
175
+ const selectedPort = normalizePort(matched.port);
176
+ if (boundDatasource && selectedHost) {
177
+ deps.profileLoader.setRuntimeTarget(boundDatasource, {
178
+ host: selectedHost,
179
+ port: selectedPort,
180
+ instanceId: matched.id,
181
+ nodeId: matched.primaryNodeId,
182
+ });
183
+ }
184
+ await reloadEngine(deps);
185
+ return formatSuccess({
186
+ project_id: projectId,
187
+ instance_id: matched.id,
188
+ instance_name: matched.name,
189
+ default_node_id: matched.primaryNodeId,
190
+ private_ips: matched.privateIps,
191
+ public_ips: matched.publicIps,
192
+ hostnames: matched.hostnames,
193
+ port: matched.port,
194
+ bound_datasource: boundDatasource,
195
+ bound_host: selectedHost,
196
+ bound_port: selectedPort,
197
+ }, {
198
+ summary: `Selected cloud instance ${matched.name} (${matched.id}).`,
199
+ metadata: metadata(context.taskId),
200
+ });
201
+ }
202
+ catch (error) {
203
+ return formatToolError(error, {
204
+ action: "select_cloud_taurus_instance",
205
+ metadata: metadata(context.taskId),
206
+ });
207
+ }
208
+ },
209
+ };
@@ -0,0 +1,2 @@
1
+ import type { ToolDefinition } from "../registry.js";
2
+ export declare const listCloudTaurusInstancesTool: ToolDefinition;
@@ -0,0 +1,73 @@
1
+ import { createCloudTaurusInstanceClient, } from "taurusdb-core";
2
+ import { z } from "zod";
3
+ import { formatSuccess } from "../../utils/formatter.js";
4
+ import { formatToolError, ToolInputError } from "../error-handling.js";
5
+ import { metadata } from "../common.js";
6
+ function toPublicInstance(item) {
7
+ return {
8
+ id: item.id,
9
+ name: item.name,
10
+ status: item.status,
11
+ mode: item.mode,
12
+ region: item.region,
13
+ datastore_version: item.datastoreVersion,
14
+ vpc_id: item.vpcId,
15
+ subnet_id: item.subnetId,
16
+ private_ips: item.privateIps,
17
+ public_ips: item.publicIps,
18
+ hostnames: item.hostnames,
19
+ port: item.port,
20
+ node_ids: item.nodeIds,
21
+ default_node_id: item.primaryNodeId,
22
+ created: item.created,
23
+ updated: item.updated,
24
+ };
25
+ }
26
+ export const listCloudTaurusInstancesTool = {
27
+ name: "list_cloud_taurus_instances",
28
+ description: "List TaurusDB/GaussDB(for MySQL) instances visible to the configured Huawei Cloud project so the user can choose an instance id.",
29
+ inputSchema: {
30
+ name: z.string().trim().min(1).optional().describe("Optional fuzzy instance name filter."),
31
+ id: z.string().trim().min(1).optional().describe("Optional exact instance id filter."),
32
+ ip: z.string().trim().min(1).optional().describe("Optional private/public IP filter."),
33
+ offset: z.number().int().min(0).optional().describe("Pagination offset. Defaults to 0."),
34
+ limit: z.number().int().positive().max(100).optional().describe("Maximum number of instances to return. Defaults to 50."),
35
+ },
36
+ async handler(input, deps, context) {
37
+ try {
38
+ const client = createCloudTaurusInstanceClient(deps.config);
39
+ if (!client) {
40
+ throw new ToolInputError("Cloud instance discovery is not configured. Provide TAURUSDB_CLOUD_REGION plus either TAURUSDB_CLOUD_AUTH_TOKEN or TAURUSDB_CLOUD_ACCESS_KEY_ID and TAURUSDB_CLOUD_SECRET_ACCESS_KEY.");
41
+ }
42
+ const items = await client.list({
43
+ name: typeof input.name === "string" ? input.name : undefined,
44
+ id: typeof input.id === "string" ? input.id : undefined,
45
+ ip: typeof input.ip === "string" ? input.ip : undefined,
46
+ offset: typeof input.offset === "number" ? input.offset : undefined,
47
+ limit: typeof input.limit === "number" ? input.limit : undefined,
48
+ });
49
+ const projectId = await client.getProjectId();
50
+ deps.config.cloud.projectId = deps.config.cloud.projectId ?? projectId;
51
+ return formatSuccess({
52
+ items: items.map(toPublicInstance),
53
+ total: items.length,
54
+ cloud: {
55
+ provider: deps.config.cloud.provider,
56
+ region: deps.config.cloud.region,
57
+ project_id: projectId,
58
+ },
59
+ }, {
60
+ summary: items.length === 1
61
+ ? "Resolved 1 cloud TaurusDB instance."
62
+ : `Resolved ${items.length} cloud TaurusDB instances.`,
63
+ metadata: metadata(context.taskId),
64
+ });
65
+ }
66
+ catch (error) {
67
+ return formatToolError(error, {
68
+ action: "list_cloud_taurus_instances",
69
+ metadata: metadata(context.taskId),
70
+ });
71
+ }
72
+ },
73
+ };
@@ -0,0 +1,9 @@
1
+ import type { ToolDefinition } from "../registry.js";
2
+ export declare const findTopSlowSqlTool: ToolDefinition;
3
+ export declare const diagnoseServiceLatencyTool: ToolDefinition;
4
+ export declare const diagnoseDbHotspotTool: ToolDefinition;
5
+ export declare const diagnoseSlowQueryTool: ToolDefinition;
6
+ export declare const diagnoseConnectionSpikeTool: ToolDefinition;
7
+ export declare const diagnoseLockContentionTool: ToolDefinition;
8
+ export declare const diagnoseStoragePressureTool: ToolDefinition;
9
+ export declare const diagnosticToolDefinitions: ToolDefinition[];