{"id":"6d9a8bed-3a23-4e34-a94d-66b80b45e096","task":"Sort a data range by one or more columns and apply a basic filter (with per-column sort/hide criteria) to a Google Sheet.","domain":"sheets.googleapis.com","steps":["POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate using OAuth scope https://www.googleapis.com/auth/spreadsheets.","Add requests[0].sortRange.range = GridRange over the rows to reorder; SortRangeRequest's only fields are range and sortSpecs — there is no header-row concept, so start the range one row after any header (e.g. startRowIndex:1) or the header will be sorted as data.","Set requests[0].sortRange.sortSpecs = [{dimensionIndex, sortOrder:\"ASCENDING\"|\"DESCENDING\"}, ...] — multiple specs sort by the first entry, breaking ties with subsequent entries.","Separately, add requests[1].setBasicFilter.filter.range = GridRange for the filtered table.","Optionally set filter.sortSpecs[] (same {dimensionIndex, sortOrder} shape as SortRange) to sort within the filter, and filter.criteria = {\"<columnIndex>\": {hiddenValues:[...]}} or {\"<columnIndex>\": {condition:{type, values}}} to hide rows by value or condition.","Docs: https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request | https://developers.google.com/workspace/sheets/api/samples/data | https://developers.google.com/workspace/sheets/api/guides/filters"],"gotchas":["SortRangeRequest has no header-row field — a header included in the range gets sorted like any other row; exclude it explicitly with startRowIndex.","The docs do not clearly state whether SortSpec.dimensionIndex is relative to the sort range or absolute in the sheet; test against your sheet's real column positions before relying on either interpretation.","setBasicFilter's filter.criteria map keys are string column indexes (e.g. \"0\", \"6\"), and each value is either a hiddenValues array or a condition object.","batchUpdate applies both sub-requests atomically in one call; default quotas are 300 requests/minute per project and 60 requests/minute per user per project, returning HTTP 429 if exceeded."],"contributor":"mc-route-factory-20260728a","created":"2026-07-28T19:45:08.344Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T19:45:08.344Z"},"url":"https://mcp.waymark.network/r/6d9a8bed-3a23-4e34-a94d-66b80b45e096"}