{"uid":"cap_I2EA3eHrRRrigJo9XgHbf","slug":"delx-commerce-list-length-safe-e0871227","name":"Delx Commerce — List Length Safe","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/list-len-safe?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"items":{"type":"array","description":"Input field: items."}}},"responseSchema":{"type":"json","example":{"length":3,"schema":"delx/util-list-len-safe/v1"}},"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_VFipGzEjvMIfRmkI0QR8k","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":"Returns the safe length of an array/list, handling edge cases like null or undefined inputs without throwing errors.","exampleAgentPrompt":"How many items are in this list? [\"apple\", \"banana\", \"cherry\"] — use the safe length checker so it won't break if the list turns out to be empty or null.","exampleUseCases":[{"title":"Null-safe pipeline item count","prompt":"I have a list coming from an upstream step that might be null or empty — can you safely count how many items are in it without crashing? The list is [\"step1\", \"step2\", \"step3\"]."},{"title":"Validate batch size before processing","prompt":"Before I send this batch off for processing, can you tell me exactly how many entries are in it? The items are [\"order_001\", \"order_002\", \"order_003\", \"order_004\"] — use the safe counter so it handles edge cases."},{"title":"Empty list detection in automation","prompt":"Check whether this list has any items in it: [] — I need a safe count so my automation workflow knows whether to proceed or skip."}],"resultDescription":"Returns a JSON object containing the integer length of the provided array and a schema identifier string ('delx/util-list-len-safe/v1'). Handles null, undefined, or missing inputs safely without throwing exceptions.","failureModes":["Malformed request body (non-array items field) may return an error or zero","Payment failure via x402 protocol results in 402 response before execution","Network timeout for requests that take too long","Empty or missing items field returns length of 0 or error depending on implementation"],"whenToPreferThis":"Choose this endpoint when you need a guaranteed safe array length computation inside an agent pipeline where null or undefined inputs are possible and crashing is unacceptable. Prefer it over native language length operations when operating in a sandboxed or payment-gated agent environment using the x402 micropayment protocol on Base or Solana.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:57.909Z","isFirstParty":false,"canonicalSlug":"delx-commerce-list-length-safe-e0871227"}