Text count words

text-count-words · version 1.0.0 · Text · free, no key needed

Count words and return their code-point average, longest word, and optional capped per-word frequencies.

Use when you need to: how many words are in this passage · count each word in supplied prose · calculate average word length.

Decide before calling

Read the versioned contract and the supported scope below. Reuse text-count-words@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-count-words@1.0.0 for how many words are in this passage. 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

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "text": "one two"
}

Response:

{
  "result": {
    "word_count": 2,
    "average_word_code_points": "3/1",
    "longest_word": "one",
    "longest_word_code_points": 3,
    "word_counts": null,
    "standard_version": "Unicode 15.1.0",
    "data_version": "unicode-15.1.0-white-space"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "text-count-words",
  "version": "1.0.0",
  "input": {
    "text": "one two"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-count-words/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"one two"}'

The machine-readable contract is at /v1/tools/text-count-words/versions/1.0.0.

CLI

node cli.mjs run text-count-words 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.