{"uid":"cap_DQl88BF_7p2Cf1XrRXkme","slug":"agent402-tools-text-truncator-7ade37dc","name":"agent402.tools Text Truncator","description":"Truncate text to a maximum length, adding an ellipsis (or custom suffix). Optionally break on word boundaries.","url":"https://agent402.tools/api/truncate","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string"},"words":{"type":"boolean","description":"Break on whole words"},"length":{"type":"number"},"suffix":{"type":"string","description":"Default …"}}},"responseSchema":{"type":"json","example":{"result":"The quick…","truncated":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kOZy8YiV_5HYVMZdyfFQw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Truncates a string to a specified maximum length, appending an ellipsis or custom suffix, with optional word-boundary awareness","exampleAgentPrompt":"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.'","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:03.139Z","isFirstParty":false}