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.

42 lines (39 loc) 1.28 kB
export function registerGenerateUlid(server) { server.registerTool("generate_ulid", { inputSchema: {}, // VS Code compliance annotations annotations: { title: "Generate ULID", readOnlyHint: false } }, async () => { try { // Simplified ULID implementation const timestamp = Date.now(); const randomPart = Math.random().toString(36).substring(2, 18); const ulid = timestamp.toString(36).toUpperCase() + randomPart.toUpperCase(); return { content: [ { type: "text", text: `Generated ULID: ${ulid} Timestamp: ${timestamp} Generated at: ${new Date(timestamp).toISOString()} Note: This is a simplified ULID implementation. For production use, please use a proper ULID library.`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error generating ULID: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } }); }