{"uid":"cap_GMmAhnC4X3XIJZf0-0HjJ","slug":"json-empty-prune-ab30605f","name":"JSON Empty Prune","description":"JSON Empty Prune: JSON Empty Prune removes selected empty string, array, and object top-level values from bounded caller-supplied values without an external provider. Call JSON Empty Prune before an agent hands structured data or a batch plan to a downstream tool with a stricter contract. Returns the bounded transformation or validation finding with counts, normalized values, and a versioned result contract for JSON Empty Prune as versioned deterministic JSON. Price: $0.001 USDC via x402 on Bas…","url":"https://api.delx.ai/api/v1/x402/json-empty-prune","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"object":{"type":"object","description":"Object supplied to JSON Empty Prune; used only for this bounded calculation and processed in memory without retention.","maxProperties":128,"additionalProperties":true}}},"responseSchema":{"type":"json","example":{"result":{"object":{"d":1},"removed_keys":["a","b","c"]},"schema":"delx/util-json-empty-prune/v1","status":"pass","evidence":{"retained":false,"input_sha256":"f9cf0bb18905a0dc7f01e28106ee0e0ef53cb457dc27e0691f35144835ca7c57","external_calls":0},"operation":"data_batch:json_empty_prune"}},"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_bbDk8EwGgee45sCGr5PVt","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":"Removes empty string, array, and object top-level values from a caller-supplied JSON object and returns counts and normalized results","exampleAgentPrompt":"Clean up this JSON object by pruning all empty strings, empty arrays, and empty objects from the top level before I hand it off downstream: {\"name\": \"Alice\", \"tags\": [], \"address\": \"\", \"meta\": {}, \"age\": 30}.","exampleUseCases":[{"title":"Sanitize API payload before handoff","prompt":"Before sending this structured order object to the fulfillment API, strip out any top-level keys that are empty strings, empty arrays, or empty objects so it doesn't fail validation: {\"orderId\": \"ABC123\", \"notes\": \"\", \"items\": [\"widget\"], \"tags\": [], \"metadata\": {}}."},{"title":"Clean agent batch plan output","prompt":"My agent just produced a batch plan as JSON and some fields came back empty — can you prune the empty top-level values from this object and tell me how many were removed? {\"taskId\": \"t1\", \"assignees\": [], \"description\": \"\", \"priority\": \"high\", \"extras\": {}}."},{"title":"Normalize form submission data","prompt":"A user submitted a form and the raw JSON has a bunch of empty top-level fields. Remove any empty strings, arrays, or objects from the top level and give me the cleaned version with counts: {\"firstName\": \"Bob\", \"lastName\": \"\", \"hobbies\": [], \"address\": {}, \"email\": \"bob@example.com\"}."}],"resultDescription":"Returns a versioned deterministic JSON object containing the pruned input object with empty top-level values removed, counts of how many entries were removed per type (empty strings, empty arrays, empty objects), and normalized values — all as a structured result envelope with a versioned result contract.","failureModes":["Object exceeds 128 top-level properties — rejected with a validation error","Malformed JSON or non-object input — returns a schema error","Payment not attached or insufficient USDC — returns 402 Payment Required","Network timeout or service unavailability — returns 5xx error"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic, in-memory JSON cleaning step with no external dependencies before handing structured data to a downstream tool with a strict contract. It is ideal for agent pipelines where empty fields would cause downstream validation failures, and when you need an auditable count of what was removed. Prefer it over custom preprocessing logic when operating in an x402 micropayment environment at minimal cost ($0.001 USDC per call).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:57:44.753Z","isFirstParty":false}