Skip to main content
Glama

text_lines

Read-onlyIdempotent

utilpeek: Sort, dedupe, trim, shuffle or number the lines of a text. For find and replace use text_replace. Returns lines after operations run in order: trim, remove_empty, dedupe (keep first), sort (lexical, natural, exact numeric or length; stable), reverse, shuffle (seeded) and number. Optional counts of the most frequent lines. At most 200,000 lines. Typically under 0.3 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>",
      "operations": "<operations>"
    },
    "name": "text_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoShuffle seed: same seed, same order.
textYesThe text (at most 200,000 characters).
top_nNoWith count_unique: how many lines to return.
sort_modeNoSort by character (lexical), decimal digit run (natural), first number's exact value (numeric; no number sorts last), or length.lexical
descendingNoFor sort: largest first.
operationsYesApplied in order: trim, remove_empty, dedupe, sort, reverse, shuffle, number.
count_uniqueNoAlso return the most frequent lines with counts.
number_startNoFor number: the first line's number.
case_insensitiveNodedupe / sort / count compare casefolded lines.
ignore_invisibleNoDedupe also ignores zero-width chars, BOM, soft hyphen.
number_separatorNoFor number: text between the number and the line..

Output Schema

NameRequiredDescriptionDefault
topNo
seedNo
textNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
sourceNo
removedNo
lines_inNo
lines_outNo
operationsNo
unique_linesNo
lines_without_numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / sort_mode / description
      Previous value: -"Sort by character (lexical), digit run (natural), first number's exact value (numeric; no number sorts last), or length."New value: +"Sort by character (lexical), decimal digit run (natural), first number's exact value (numeric; no number sorts last), or length."
  2. Changed1 schema field changed
    • changedInput schema / properties / sort_mode / description
      Previous value: -"For sort: lexical (by character), natural (item 9 before item 10), numeric (by the first number's value; lines without one last) or length."New value: +"Sort by character (lexical), digit run (natural), first number's exact value (numeric; no number sorts last), or length."
  3. Changed3 schema fields changed
    • changedInput schema / properties / sort_mode / description
      Previous value: -"For sort: lexical (by character), natural (item 9 before item 10) or length."New value: +"For sort: lexical (by character), natural (item 9 before item 10), numeric (by the first number's value; lines without one last) or length."
    • changedInput schema / properties / sort_mode / enum
      Previous value: -[
      -  "lexical",
      -  "natural",
      -  "length"
      -]New value: +[
      +  "lexical",
      +  "natural",
      +  "numeric",
      +  "length"
      +]
    • addedOutput schema / properties / lines_without_number
      Added value: +{
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  4. Changed12 schema fields changed
    • removedInput schema / properties / case_insensitive / title
      Removed value: -"Case Insensitive"
    • removedInput schema / properties / count_unique / title
      Removed value: -"Count Unique"
    • removedInput schema / properties / descending / title
      Removed value: -"Descending"
    • removedInput schema / properties / ignore_invisible / title
      Removed value: -"Ignore Invisible"
    • removedInput schema / properties / number_separator / title
      Removed value: -"Number Separator"
    • removedInput schema / properties / number_start / title
      Removed value: -"Number Start"
    • removedInput schema / properties / operations / title
      Removed value: -"Operations"
    • removedInput schema / properties / seed / title
      Removed value: -"Seed"
    • removedInput schema / properties / sort_mode / title
      Removed value: -"Sort Mode"
    • removedInput schema / properties / text / title
      Removed value: -"Text"
    • removedInput schema / properties / top_n / title
      Removed value: -"Top N"
    • removedInput schema / title
      Removed value: -"text_linesArguments"
  5. Changed6 schema fields changed
    • changedInput schema / properties / descending / description
      Previous value: -"For sort: largest first (default false: ascending)."New value: +"For sort: largest first."
    • changedInput schema / properties / ignore_invisible / description
      Previous value: -"Dedupe / count also ignore zero-width characters, BOM and soft hyphen (lines are always compared in NFC)."New value: +"Dedupe also ignores zero-width chars, BOM, soft hyphen."
    • changedInput schema / properties / number_separator / description
      Previous value: -"For number: text between the number and the line (at most 10 characters; default \". \")."New value: +"For number: text between the number and the line."
    • changedInput schema / properties / number_start / description
      Previous value: -"For number: the first line's number (-1,000,000 to 1,000,000; default 1)."New value: +"For number: the first line's number."
    • changedInput schema / properties / sort_mode / description
      Previous value: -"For sort: lexical (default, by character), natural (numbers by value: item 9 before item 10) or length (shortest first)."New value: +"For sort: lexical (by character), natural (item 9 before item 10) or length."
    • changedInput schema / properties / top_n / description
      Previous value: -"With count_unique: how many of the most frequent lines to return (1-1000, default 100)."New value: +"With count_unique: how many lines to return."
  6. Changed1 schema field changed
    • addedInput schema / properties / ignore_invisible
      Added value: +{
      +  "default": false,
      +  "description": "Dedupe / count also ignore zero-width characters, BOM and soft hyphen (lines are always compared in NFC).",
      +  "title": "Ignore Invisible",
      +  "type": "boolean"
      +}
  7. Changed6 schema fields changed
    • addedInput schema / properties / descending / description
      Added value: +"For sort: largest first (default false: ascending)."
    • addedInput schema / properties / number_separator / description
      Added value: +"For number: text between the number and the line (at most 10 characters; default \". \")."
    • addedInput schema / properties / number_start / description
      Added value: +"For number: the first line's number (-1,000,000 to 1,000,000; default 1)."
    • addedInput schema / properties / sort_mode / description
      Added value: +"For sort: lexical (default, by character), natural (numbers by value: item 9 before item 10) or length (shortest first)."
    • addedInput schema / properties / top_n / description
      Added value: +"With count_unique: how many of the most frequent lines to return (1-1000, default 100)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "lines_in": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "lines_out": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "operations": {
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "removed": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "seed": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "text": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "top": {
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "unique_lines": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  8. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only/idempotent/non-destructive, but the description adds real behavior beyond them: the exact execution order of operations, dedupe keeping the first occurrence, stable sort semantics, a 200,000-line cap, typical latency under 0.3 s, pricing and free-tier quota, and an explicit privacy statement that submitted text is never logged or stored.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose then routing, then the behavioral facts, with zero filler sentences. The operation list restates the schema enum order, which is mild redundancy, but it validly reinforces sequencing and keeps the definition self-contained.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter tool with an output schema, the description supplies everything an agent needs to call it correctly: operation ordering, limits, determinism via seed, cost/quota, and privacy. Return shape is appropriately left to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so a 3 is the floor; the description earns more by stating details the schema does not, notably that dedupe keeps the first line and that sort is stable, plus the ordered application of operations and the seeded shuffle guarantee. Most remaining parameter meaning (sort_mode enum, top_n, separator) is left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb set and resource ('Sort, dedupe, trim, shuffle or number the lines of a text') and immediately names the sibling that covers the adjacent job ('For find and replace use text_replace'). An agent can distinguish it from text_replace or text_frequency without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the find-and-replace case to text_replace, and the described operation set implies when this tool applies (line-level cleanup/ordering). It does not address nearer-looking siblings such as check_text_duplicate or text_frequency, which could plausibly be confused with the dedupe and count_unique features, so it stops short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources