UNPKG

@takashito/linode-mcp-server

Version:

MCP server for Linode API

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