{"uid":"cap__a1qVLL2yJ8CPFuZgxZWe","slug":"delx-string-trunc-835f7c87","name":"Delx String Trunc","description":"Truncate a string to max_chars with optional ellipsis — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that already converted…","url":"https://api.delx.ai/api/v1/x402/string-trunc","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input field: text."},"ellipsis":{"type":"string","description":"Input field: ellipsis."},"max_chars":{"type":"integer","description":"Input field: max chars."}}},"responseSchema":{"type":"json","example":{"ok":true,"result":"abcdefghi…","schema":"delx/util-string-trunc/v1","max_chars":10,"truncated":true,"original_chars":26}},"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_0UeOxnhyTSi8rlNES8Wh_","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 character length, optionally appending an ellipsis suffix","exampleAgentPrompt":"Truncate this product description to 80 characters and add '...' at the end if it gets cut: 'Our premium hand-crafted artisan coffee beans are sourced directly from sustainable farms in Colombia and Ethiopia.'","exampleUseCases":[{"title":"Clip UI label to character budget","prompt":"I need to shorten the string 'Quarterly Revenue Report for North America — Q4 2024 Final Draft' to at most 50 characters and append '…' if it was cut."},{"title":"Preflight text length enforcement","prompt":"Before I send this notification message to the push service, trim it down to 160 characters max — add '...' if it's longer. The text is: 'Your order #98432 has been confirmed and is now being prepared by our warehouse team. Estimated delivery is Thursday, January 16th between 2–6 PM.'"},{"title":"Truncate agent log entry for storage","prompt":"Cut this log line to 120 characters with no ellipsis: 'AgentRun[abc123] completed task classify_sentiment on input payload {text: \"I love this product but shipping was slow\"} in 340ms with result POSITIVE.'"}],"resultDescription":"A deterministic JSON object containing the truncated string result — the input text clipped at max_chars characters, with the optional ellipsis appended if truncation occurred. The response is machine-readable, stateless, and consistent for identical inputs.","failureModes":["Missing required fields (text or max_chars) return a validation error","max_chars of zero or negative may return an error or empty string","Payment failure via x402 protocol returns a 402 status with payment details","Malformed JSON body returns a 400 error","Very large input strings may hit request size limits"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, stateless, zero-dependency string truncation in an agent pipeline — especially during preflight formatting steps, payload preparation, or when enforcing character limits on dynamic text before display, storage, or transport. Prefer it over in-code string slicing when you want a consistent, billable, auditable micro-utility call with JSON output that integrates cleanly into x402-based agentic workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:51:43.753Z","isFirstParty":false}