Text lines count

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

Count exact line multiplicities in first-seen order.

Use when you need to: text lines count · count lines · line histogram.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "text": "a\nb\na\n"
}

Response:

{
  "result": {
    "items": [
      {
        "line": "a",
        "count": 2
      },
      {
        "line": "b",
        "count": 1
      }
    ],
    "lines_in": 3,
    "unique": 2
  }
}

How to call it

MCP

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

{
  "id": "text-lines-count",
  "version": "1.0.0",
  "input": {
    "text": "a\nb\na\n"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-lines-count/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"a\nb\na\n"}'

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

CLI

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

Get the client at /clients/cli/.