it-tools-mcp
Version:
Full MCP 2025-06-18 compliant server with 121+ IT tools, logging, ping, progress tracking, cancellation, and sampling utilities
38 lines (37 loc) • 1.09 kB
JavaScript
import { z } from "zod";
export function registerDecodeUrl(server) {
server.registerTool("decode_url", {
description: "URL decode text",
inputSchema: {
text: z.string().describe("URL encoded text to decode"),
},
// VS Code compliance annotations
annotations: {
title: "Decode Url",
description: "URL decode text",
readOnlyHint: false
}
}, async ({ text }) => {
try {
const decoded = decodeURIComponent(text);
return {
content: [
{
type: "text",
text: `URL decoded: ${decoded}`,
},
],
};
}
catch (error) {
return {
content: [
{
type: "text",
text: `Error decoding URL: ${error instanceof Error ? error.message : 'Unknown error'}`,
},
],
};
}
});
}