# agent402.tools Sort Lines

> agent402.tools Sort Lines is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Sorts the lines of a text block in ascending, descending, or numeric order, with optional duplicate removal and case-insensitive comparison.

## Facts

- Endpoint: POST https://agent402.tools/api/sort-lines
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-sort-lines-cda926a7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_R6Luoavhp3DBd5_IP8Djh

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-sort-lines-cda926a7 -d '<json body>'
```

Example prompt: Sort these lines alphabetically in descending order and remove any duplicates: 'Banana\nApple\nCherry\nApple\nDate' — treat it as case-insensitive.

## When to prefer this

Use this endpoint when you need a simple, reliable server-side line sort with configurable direction, numeric awareness, deduplication, and case-insensitivity — especially when you want to avoid implementing sorting logic client-side or need consistent behavior across platforms.

## Known failure modes

- Empty or missing text field returns an error
- Invalid order value (not asc/desc/numeric) may return a validation error
- Very large text inputs may time out or exceed payload limits
- Non-numeric lines when using numeric sort may produce unexpected ordering

## How this service works

Sort the lines of a text. order: asc (default) | desc | numeric. unique:true removes duplicates; ci:true is case-insensitive.

## Output

Returns the input text with lines reordered according to the specified sort order (asc, desc, or numeric). Duplicate lines are removed if unique=true. Comparison is case-insensitive if ci=true.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ci": {
   "type": "boolean"
  },
  "text": {
   "type": "string"
  },
  "order": {
   "type": "string",
   "description": "asc | desc | numeric"
  },
  "unique": {
   "type": "boolean"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lines": 3,
  "result": "apple\nbanana\ncherry"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-sort-lines-cda926a7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
