# Word frequency counter

Count how often each word appears in a text and list the most common ones, optionally skipping stop words.

- Endpoint: `POST https://setget.net/v1/tools/word-frequency` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `word-frequency`
- Page: https://setget.net/tools/word-frequency

## Inputs

- `text` (required, string): The text to analyse.
- `top` (optional, integer, default `10`, range 1..1000): How many words to list.
- `min_length` (optional, integer, default `1`, range 1..100): Ignore words shorter than this many characters.
- `case_sensitive` (optional, boolean, default `false`): Count "Word" and "word" separately.
- `ignore_stop_words` (optional, boolean, default `false`): Leave out common English words such as "the", "and" and "of".

## Example 1

```json
{"input":{"text":"the cat and the hat and the bat","top":2}}
```

Result:

```json
{"words":[{"word":"the","count":3},{"word":"and","count":2}],"total_words":8,"unique_words":5}
```

## Example 2: Without stop words

```json
{"input":{"text":"The cat and the hat and the bat","ignore_stop_words":true}}
```

Result:

```json
{"words":[{"word":"cat","count":1},{"word":"hat","count":1},{"word":"bat","count":1}],"total_words":3,"unique_words":3}
```

**What counts as a word?** A run of letters or digits. Apostrophes inside a word are kept, so "don't" is one word; "well-known" counts as two.

**How are ties ordered?** Words with the same count are listed in the order they first appear in the text.

**What do the totals cover?** total_words and unique_words count the words left after the min_length and stop-word filters.
