Skip to main content
Glama

uniq

Read-only

Collapse adjacent duplicate lines, optionally counting occurrences or showing only unique/duplicate lines. Combine with 'sort' for full deduplication.

Instructions

Collapse adjacent duplicate lines, optionally counting occurrences or showing only unique/duplicate lines. Read-only, no side effects. Returns JSON by default; use --raw for plain output. Use to remove or count consecutive duplicates. IMPORTANT: only works on adjacent duplicates — pipe through 'sort' first for full deduplication. Not for standalone dedup without sorting — always combine with 'sort' for complete duplicate removal. See also 'sort'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoInclude duplicate counts in raw output.
encodingNoText encoding.utf-8
ignore_caseNoCompare case-insensitively.
max_linesNoMaximum JSON groups to emit.
pathsNoFiles to read, or '-' for stdin. Defaults to stdin.
rawNoWrite plain transformed text to stdout.
repeatedNoEmit only repeated groups.
unique_onlyNoEmit only non-repeated groups.
Behavior5/5

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

Annotations provide readOnlyHint, and description adds that it is read-only with no side effects, plus details on default JSON output and raw mode. No contradictions.

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 core function, but includes repeated emphasis on sorting requirement which could be trimmed. Still efficient overall.

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

Completeness4/5

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

Covers output formats, key usage constraints, and references 'sort'. No output schema exists but description adequately explains return behavior. Slightly lengthy but complete.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. The description does not add parameter-level details beyond what the schema already provides; it focuses on tool behavior.

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?

The description clearly states the tool collapses adjacent duplicate lines with options for counting and filtering, distinguishing it from siblings like 'sort' by emphasizing adjacency.

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

Usage Guidelines5/5

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

Explicitly explains when to use (adjacent duplicates) and when not to (standalone dedup), with clear guidance to combine with 'sort' for full deduplication, and references sibling tool 'sort'.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/caseSHY/AI-CLI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server