# agent402.tools Text Truncator

> agent402.tools Text Truncator 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).

Truncates a string to a specified maximum length, appending an ellipsis or custom suffix, with optional word-boundary awareness

## Facts

- Endpoint: POST https://agent402.tools/api/truncate
- 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-text-truncator-7ade37dc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DQl88BF_7p2Cf1XrRXkme

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-text-truncator-7ade37dc -d '<json body>'
```

Example prompt: Truncate this product description to 150 characters, break only on whole words, and add '...' at the end: 'Our premium organic cold-brew coffee is sourced from single-origin Ethiopian beans, slow-steeped for 24 hours to deliver a smooth, rich flavor with zero bitterness.'

## When to prefer this

Use this endpoint when you need a reliable, configurable string-truncation utility with word-boundary support and a custom suffix — especially in automated pipelines where you need consistent, predictable clipping behavior without rolling your own truncation logic. Prefer it over ad-hoc substring calls when clean word-boundary breaks and custom suffixes are important.

## Known failure modes

- Text field missing — returns 400 bad request
- Length is zero or negative — may return error or empty string
- Suffix longer than target length — truncation may produce only the suffix
- Non-integer or non-numeric length value — schema validation error
- Very large text inputs may be rejected if payload size limits are hit

## How this service works

Truncate text to a maximum length, adding an ellipsis (or custom suffix). Optionally break on word boundaries.

## Output

The truncated version of the input text, cut to the specified character length, with the ellipsis (or custom suffix) appended at the cut point, optionally aligned to the nearest word boundary so no words are split mid-word.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string"
  },
  "words": {
   "type": "boolean",
   "description": "Break on whole words"
  },
  "length": {
   "type": "number"
  },
  "suffix": {
   "type": "string",
   "description": "Default …"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "The quick…",
  "truncated": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-text-truncator-7ade37dc/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)
