UNPKG

it-tools-mcp

Version:

MCP-compliant server access to over 100 IT tools and utilities commonly used by developers, system administrators, and IT professionals.

28 lines (27 loc) 808 B
import { z } from "zod"; export function registerTextKebabcase(server) { server.registerTool("convert_text_to_kebabcase", { inputSchema: { text: z.string().describe("Text to convert to kebab-case"), }, // VS Code compliance annotations annotations: { title: "Convert Text To Kebabcase", readOnlyHint: false } }, async ({ text }) => { const kebabCase = text .replace(/([a-z])([A-Z])/g, '$1-$2') .replace(/[^a-zA-Z0-9]+/g, '-') .toLowerCase() .replace(/^-+|-+$/g, ''); return { content: [ { type: "text", text: `kebab-case: ${kebabCase}`, }, ], }; }); }