Skip to main content
Glama
paladini

devutils-mcp-server

slugify

Convert strings to URL-friendly slugs by removing special characters, replacing spaces with hyphens, and converting to lowercase for clean web addresses.

Instructions

Convert a string to a URL-friendly slug. Removes special characters, replaces spaces with hyphens, and lowercases everything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe string to slugify

Implementation Reference

  • Implementation of the 'slugify' MCP tool, which converts an input string into a URL-friendly slug.
    // Slugify
    server.tool(
      "slugify",
      "Convert a string to a URL-friendly slug. Removes special characters, replaces spaces with hyphens, and lowercases everything.",
      { input: z.string().describe("The string to slugify") },
      async ({ input }) => {
        const slug = input
          .toLowerCase()
          .normalize("NFD")
          .replace(/[\u0300-\u036f]/g, "") // Remove diacritics
          .replace(/[^a-z0-9\s-]/g, "") // Remove special chars
          .replace(/\s+/g, "-") // Spaces to hyphens
          .replace(/-+/g, "-") // Collapse hyphens
          .replace(/^-+|-+$/g, ""); // Trim hyphens
    
        return { content: [{ type: "text" as const, text: slug }] };
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paladini/devutils-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server