{"uid":"cap_z9TXqoR2-agxIeCebztdI","slug":"g-forge-sort-json-records-532b8685","name":"G-Forge Sort JSON Records","description":"Put JSON records in the order your report or next API expects. Stable ascending or descending sort by one top-level text or numeric field; equal keys retain their order. Missing keys and mixed sort-key types are rejected. Up to 5,000 rows; not a multi-field ranking engine.","url":"https://api.getretold.com/services/agent-auto-launch-sort/invoke?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"value":{"type":"object","required":["rows","field"],"properties":{"rows":{"type":"array","items":{"type":"object"},"maxItems":5000},"field":{"type":"string"},"descending":{"type":"boolean"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dTNO1pz0b3zn1MtHddbqv","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sorts an array of JSON objects in stable ascending or descending order by a single top-level field (text or numeric).","exampleAgentPrompt":"Sort these JSON records by the 'created_at' field in descending order so the newest entries come first.","exampleUseCases":[{"title":"Sort sales report by revenue","prompt":"I have a JSON array of sales records and I need them sorted by the 'revenue' field in descending order so the highest earners appear at the top of my report."},{"title":"Alphabetize product catalog","prompt":"Can you sort my product JSON records alphabetically by the 'name' field in ascending order before I send them to the next API?"},{"title":"Order events by timestamp","prompt":"Take these JSON event records and sort them by the 'event_time' field ascending so they're in chronological order for the timeline view."}],"resultDescription":"Returns the input JSON records array reordered by the specified field, with stable sort preserving the relative order of records that share equal key values. The response reflects strict ascending or descending ordering on one top-level text or numeric field. Requests with missing sort keys or mixed key types are rejected with an error.","failureModes":["Missing sort field in one or more records — request rejected","Mixed types on the sort key field (e.g. some numeric, some string) — request rejected","Array exceeds 5,000 rows — request rejected","Invalid JSON body or malformed rows — validation error","Unsupported multi-field sort attempted — not supported, single field only"],"whenToPreferThis":"Use this endpoint when you need a simple, stable single-field sort of up to 5,000 JSON records as part of a data pipeline or before passing data to a downstream API or report. Prefer it over client-side sorting when the agent runtime lacks sorting utilities, or when you need a guaranteed stable sort with uniform type enforcement. It is not suitable for multi-field ranking, fuzzy ordering, or datasets exceeding 5,000 rows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-24T12:30:03.284Z","isFirstParty":false,"canonicalSlug":"g-forge-sort-json-records-532b8685"}