UNPKG

it-tools-mcp

Version:

Full MCP 2025-06-18 compliant server with 121+ IT tools, logging, ping, progress tracking, cancellation, and sampling utilities

39 lines (38 loc) 1.23 kB
import { z } from "zod"; export function registerConvertTomlJson(server) { server.registerTool("convert_toml_to_json", { description: "Convert TOML to JSON format", inputSchema: { toml: z.string().describe("TOML string to convert"), }, // VS Code compliance annotations annotations: { title: "Convert Toml To Json", description: "Convert TOML to JSON format", readOnlyHint: false } }, async ({ toml: tomlString }) => { try { const toml = await import("@iarna/toml"); const result = toml.parse(tomlString); return { content: [ { type: "text", text: `JSON result:\n${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error converting TOML to JSON: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } }); }