# Text slugify

`text-slugify` · version 1.0.0 · Text · free, no key needed

Create a deterministic ASCII or Unicode slug using an explicit, documented normalization profile.

**Use when you need to: slugify text · make an ASCII slug · make a Unicode slug.**

## Decide before calling

Read the [versioned contract](/v1/tools/text-slugify/versions/1.0.0) and the supported scope below. Reuse `text-slugify@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `text-slugify@1.0.0` for slugify text. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- slugify text
- make an ASCII slug
- make a Unicode slug
- convert title to URL name
- normalize words to a slug
- create underscore slug

## Not supported

- GitHub heading duplicate anchors
- language-specific transliteration
- checking an existing URL-safe name

## Behavior

- The caller selects profile "ascii" or "unicode"; this tool does not claim one slug convention is universal.
- ascii uses runtime Unicode NFKD, removes combining marks, drops remaining non-ASCII characters, lowercases, and retains ASCII a-z and 0-9.
- unicode uses runtime Unicode NFKC, lowercases, removes zero-width joiners (U+200C, U+200D), variation selectors (U+FE00 to U+FE0F) and the keycap mark (U+20E3) without splitting the word, and retains Unicode letters and numbers plus any combining marks that follow them, so Hindi vowel signs and Hebrew points stay in the word.
- A combining mark with no letter or number before it is dropped as a separator. Lowercasing is the runtime default, not locale-specific, so Turkish capital I with dot gives i plus a combining dot in unicode and i in ascii.
- Runs of all other characters become one selected separator; leading and trailing separators are removed. The separator defaults to hyphen. Text with no retained characters gives an empty slug.
- Normalization can lengthen text. A slug longer than 4096 UTF-16 code units is rejected with limit_exceeded rather than returned.

## Input

- `text` (string, required): min length 1; max length 4096
- `profile` (one of "ascii", "unicode", required)
- `separator` (one of "-", "_", optional): default `"-"`

## Output

- `slug` (string, required): max length 4096

## Limits

- max text bytes: 4096
- max slug chars: 4096

## Example

Request input:

```json
{
  "text": "Crème brûlée",
  "profile": "ascii"
}
```

Response:

```json
{
  "result": {
    "slug": "creme-brulee"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "text-slugify",
  "version": "1.0.0",
  "input": {
    "text": "Crème brûlée",
    "profile": "ascii"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/text-slugify/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"Crème brûlée","profile":"ascii"}'
```

The machine-readable contract is at [/v1/tools/text-slugify/versions/1.0.0](/v1/tools/text-slugify/versions/1.0.0).

### CLI

```sh
node cli.mjs run text-slugify 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Text run length encode](/tools/text-run-length-encode): Run-length encode Unicode text into canonical count:HEX; records and return the encoded string.
- [Citation record normalize](/tools/citation-record-normalize): Normalize one CSL 1.0.2 citation record: NFC, whitespace, empty values, DOI wrapper, page dashes, dates; lists changes.
- [Text wrap width](/tools/text-wrap-width): Hard-wrap text by Unicode code-point width and return the resulting lines.
- [Text line endings normalize](/tools/text-line-endings-normalize): Normalize all line endings in a text to a specific format (LF, CRLF, or CR).
- [Text apply unified patch](/tools/text-apply-unified-patch): Apply a one-file unified patch to text at original line addresses with exact hunk matches.
- [Text paragraphs split](/tools/text-paragraphs-split): Split text into paragraphs separated by blank lines (CommonMark line rules) with code point spans and line numbers.
