@mcp-apps/kusto-mcp-server
Version:
MCP server for interacting with Kusto databases
38 lines • 1.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.listTablesTool = void 0;
const zod_1 = require("zod");
const kustoService_1 = require("../services/kustoService");
// Tool to list tables in the database
exports.listTablesTool = {
name: "list_tables",
description: `This tool lists all tables in the Kusto database.
The result is a list of table names in a string format separated by commas.
Inputs: clusterUrl, database.`,
parameters: {
clusterUrl: zod_1.z.string().describe("The Kusto cluster URL (e.g., https://yourcluster.kusto.windows.net)"),
database: zod_1.z.string().describe("The name of the database in the Kusto cluster")
},
handler: async ({ clusterUrl, database }) => {
try {
const tables = await kustoService_1.KustoService.getTables(clusterUrl, database);
return {
content: [{
type: "text",
text: `Result: ${JSON.stringify(tables, null, 2)}`
}]
};
}
catch (error) {
console.error("Error listing tables:", error);
const errorMessage = error instanceof Error ? error.message : String(error);
return {
content: [{
type: "text",
text: `Error listing tables: ${errorMessage}`
}]
};
}
}
};
//# sourceMappingURL=list-tables.js.map