UNPKG

@takashito/linode-mcp-server

Version:

MCP server for Linode API

126 lines 5.78 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.registerLongviewTools = registerLongviewTools; const client_1 = require("../../client"); const schemas = __importStar(require("./schemas")); const errorHandler_1 = require("../common/errorHandler"); function registerLongviewTools(server, client) { // Longview client operations server.addTool({ name: 'list_longview_clients', description: 'Get a list of all Longview clients', parameters: schemas.listLongviewClientsSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const paginationParams = { page: params.page, page_size: params.page_size }; const result = await (0, client_1.createClient)(context, server).longview.getLongviewClients(paginationParams); return JSON.stringify(result, null, 2); }) }); server.addTool({ name: 'get_longview_client', description: 'Get details for a specific Longview client', parameters: schemas.getLongviewClientSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const result = await (0, client_1.createClient)(context, server).longview.getLongviewClient(params.id); return JSON.stringify(result, null, 2); }) }); server.addTool({ name: 'create_longview_client', description: 'Create a new Longview client', parameters: schemas.createLongviewClientSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const result = await (0, client_1.createClient)(context, server).longview.createLongviewClient(params); return JSON.stringify(result, null, 2); }) }); server.addTool({ name: 'update_longview_client', description: 'Update a Longview client', parameters: schemas.updateLongviewClientSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const { id, ...updateData } = params; const result = await (0, client_1.createClient)(context, server).longview.updateLongviewClient(id, updateData); return JSON.stringify(result, null, 2); }) }); server.addTool({ name: 'delete_longview_client', description: 'Delete a Longview client', parameters: schemas.deleteLongviewClientSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { await (0, client_1.createClient)(context, server).longview.deleteLongviewClient(params.id); return JSON.stringify({ success: true }, null, 2); }) }); // Longview subscription operations server.addTool({ name: 'list_longview_subscriptions', description: 'Get a list of all Longview subscription plans', parameters: schemas.listLongviewSubscriptionsSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const paginationParams = { page: params.page, page_size: params.page_size }; const result = await (0, client_1.createClient)(context, server).longview.getLongviewSubscriptions(paginationParams); return JSON.stringify(result, null, 2); }) }); server.addTool({ name: 'get_longview_subscription', description: 'Get details for a specific Longview subscription plan', parameters: schemas.getLongviewSubscriptionSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const result = await (0, client_1.createClient)(context, server).longview.getLongviewSubscription(params.id); return JSON.stringify(result, null, 2); }) }); // Longview data operations server.addTool({ name: 'get_longview_data', description: 'Get monitoring data from a Longview client', parameters: schemas.getLongviewDataSchema, execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const result = await (0, client_1.createClient)(context, server).longview.getLongviewData(params.id); return JSON.stringify(result, null, 2); }) }); } //# sourceMappingURL=tools.js.map