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) • 825 B
JavaScript
import { z } from "zod";
export function registerTextCamelcase(server) {
server.registerTool("convert_text_to_camelcase", {
inputSchema: {
text: z.string().describe("Text to convert to camelCase"),
},
// VS Code compliance annotations
annotations: {
title: "Convert to camelCase",
readOnlyHint: false
}
}, async ({ text }) => {
const camelCase = text
.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => {
return index === 0 ? word.toLowerCase() : word.toUpperCase();
})
.replace(/\s+/g, '');
return {
content: [
{
type: "text",
text: `camelCase: ${camelCase}`,
},
],
};
});
}