it-tools-mcp
Version:
Full MCP 2025-06-18 compliant server with 121+ IT tools, logging, ping, progress tracking, cancellation, and sampling utilities
30 lines (29 loc) • 904 B
JavaScript
import { z } from "zod";
export function registerTextSnakecase(server) {
server.registerTool("text_snakecase", {
description: "Convert text to snake_case",
inputSchema: {
text: z.string().describe("Text to convert to snake_case"),
},
// VS Code compliance annotations
annotations: {
title: "Convert Text To Snake Case",
description: "Convert text to snake_case",
readOnlyHint: false
}
}, async ({ text }) => {
const snakeCase = text
.replace(/([a-z])([A-Z])/g, '$1_$2')
.replace(/[^a-zA-Z0-9]+/g, '_')
.toLowerCase()
.replace(/^_+|_+$/g, '');
return {
content: [
{
type: "text",
text: `snake_case: ${snakeCase}`,
},
],
};
});
}