UNPKG

@takashito/linode-mcp-server

Version:

MCP server for Linode API

66 lines 2.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerStackScriptsTools = registerStackScriptsTools; const schemas_1 = require("../common/schemas"); const client_1 = require("../../client"); const schemas_2 = require("./schemas"); const errorHandler_1 = require("../common/errorHandler"); /** * Register StackScripts tools with the MCP server */ function registerStackScriptsTools(server) { // List StackScripts server.addTool({ name: 'list_stackscripts', description: 'Get a list of all StackScripts', parameters: (0, schemas_1.mcpInput)(schemas_2.listStackScriptsSchema), execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const result = await (0, client_1.createClient)(context).stackScripts.getStackScripts(params); return JSON.stringify(result, null, 2); }) }); // Get a specific StackScript server.addTool({ name: 'get_stackscript', description: 'Get details for a specific StackScript', parameters: (0, schemas_1.mcpInput)(schemas_2.getStackScriptSchema), execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const { id } = params; const result = await (0, client_1.createClient)(context).stackScripts.getStackScript(id); return JSON.stringify(result, null, 2); }) }); // Create a StackScript server.addTool({ name: 'create_stackscript', description: 'Create a new StackScript', parameters: (0, schemas_1.mcpInput)(schemas_2.createStackScriptSchema), execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const result = await (0, client_1.createClient)(context).stackScripts.createStackScript(params); return JSON.stringify(result, null, 2); }) }); // Update a StackScript server.addTool({ name: 'update_stackscript', description: 'Update an existing StackScript', parameters: (0, schemas_1.mcpInput)(schemas_2.updateStackScriptSchema), execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const { id, ...data } = params; const result = await (0, client_1.createClient)(context).stackScripts.updateStackScript(id, data); return JSON.stringify(result, null, 2); }) }); // Delete a StackScript server.addTool({ name: 'delete_stackscript', description: 'Delete a StackScript', parameters: (0, schemas_1.mcpInput)(schemas_2.deleteStackScriptSchema), execute: (0, errorHandler_1.withErrorHandling)(async (params, context) => { const { id } = params; await (0, client_1.createClient)(context).stackScripts.deleteStackScript(id); return JSON.stringify({ success: true }, null, 2); }) }); } //# sourceMappingURL=tools.js.map