Skip to content

feat(google): Maps Pollen/Solar, Custom Search expansion, and live-API fixes across Google integrations#5113

Merged
waleedlatif1 merged 8 commits into
stagingfrom
feat/google-integrations-audit
Jun 17, 2026
Merged

feat(google): Maps Pollen/Solar, Custom Search expansion, and live-API fixes across Google integrations#5113
waleedlatif1 merged 8 commits into
stagingfrom
feat/google-integrations-audit

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Adds new Google Maps capabilities, expands Google Custom Search, and fixes a batch of correctness issues found by validating every Google integration against the live API docs.

New capability

  • Google Maps — new Pollen Forecast and Solar Potential tools (API-key, google_cloud BYOK; same auth path as the existing Maps tools).
  • Google Custom Search — new params (start, dateRestrict, fileType, safe, searchType, siteSearch/siteSearchFilter, lr, gl, sort), new result fields (htmlTitle, htmlSnippet, formattedUrl, mime, fileFormat, cacheId, image), and a nextPageStartIndex pagination output.

Fixes (validated against live API docs)

  • Google Ads — bumped all 6 tools from the sunset v19 to v24 (every call was failing).
  • Google Groups — forward the OAuth credential under oauthCredential (11 ops were silently dropping the token); forward all update_settings fields; JSON.stringify the update_settings/add_alias bodies.
  • Google Contacts — include the required metadata.sources[].etag in updateContact (was 400ing every update).
  • Google Slides — remove the unsupported GIF thumbnail mimeType (the API only allows PNG).
  • Google Sheets — wire the existing delete_rows/delete_sheet/delete_spreadsheet tools into the V2 block (were registered but unreachable from the UI).
  • Google Custom Search — throw on API error responses instead of returning empty-but-successful; num is now optional + numeric-coerced; pagemap typed as unknown.

Notes

  • Backwards compatible — no tool IDs, operations, params, or output fields were renamed or removed; all additions are optional.
  • One known limitation (intentionally unchanged): Google Groups get_settings/update_settings require the apps.groups.settings scope, which is not granted; those two operations remain non-functional (pre-existing). No new OAuth scopes are added in this PR.
  • Behavior change worth noting: Custom Search now surfaces API errors (quota/auth) instead of silently returning empty results.
  • Docs regenerated via generate-docs for the affected integrations.

Verification

  • tsc — 0 errors
  • bun run check:api-validation — passes
  • biome — clean
  • Each changed integration validated against live Google API docs.

…oups/Contacts/Slides

New capability:
- Google Maps: add Pollen Forecast and Solar Potential tools (API-key, google_cloud BYOK)
- Google Custom Search: add start/dateRestrict/fileType/safe/searchType/siteSearch/
  siteSearchFilter/lr/gl/sort params, htmlTitle/htmlSnippet/formattedUrl/mime/fileFormat/
  cacheId/image result fields, and nextPageStartIndex pagination

Fixes (validated against live API docs):
- Google Ads: bump all tools from sunset v19 to v24
- Google Groups: forward OAuth credential under oauthCredential (was dropping token in 11
  ops), forward all update_settings fields, JSON.stringify update_settings/add_alias bodies
- Google Contacts: include required metadata.sources[].etag in updateContact body (fixed 400)
- Google Slides: remove unsupported GIF thumbnail mimeType (API only allows PNG)
- Google Sheets: wire delete_rows/delete_sheet/delete_spreadsheet into the V2 block
- Google Custom Search: throw on API error responses instead of returning empty success;
  num optional + Number-coerced; pagemap typed unknown
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 17, 2026 7:01pm

Request Review

@cursor

cursor Bot commented Jun 17, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Sheets delete-spreadsheet is destructive and Custom Search now surfaces errors instead of silent empty results; Google Ads API version bump affects all Ads calls but is required for a working API.

Overview
Adds Google Maps Pollen Forecast and Solar Potential tools and wires them through the Maps block, registry, and docs.

Google Custom Search gains optional advanced query params (pagination, filters, image search), richer result fields, nextPageStartIndex, and throws on API errors instead of returning empty success; num is optional with numeric coercion.

Google Sheets V2 exposes Delete Rows, Delete Sheet, and Delete Spreadsheet in the UI block (tools were already registered).

Google Ads endpoints move from sunset v19 to v24. Google Groups passes oauthCredential consistently, JSON-stringifies settings/alias bodies, and documents expanded enum values. Google Contacts updateContact sends required metadata.sources etag. Google Slides drops unsupported GIF thumbnails (PNG only).

Integration docs and integrations.json operation counts are updated accordingly.

Reviewed by Cursor Bugbot for commit f978967. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds two new Google Maps tools (Pollen Forecast, Solar Potential), expands Google Custom Search with ten new parameters and enriched result fields, and fixes a batch of correctness defects found by validating integrations against live API docs.

  • New tools: google_maps_pollen and google_maps_solar are properly wired into the registry, the Maps block, and integrations.json; both guard against non-200 responses.
  • Bug fixes: Google Ads bumped from the sunset v19 to v24; Google Groups operations now forward the OAuth token under oauthCredential (was credential); add_alias and update_settings bodies are now JSON.stringify'd; Google Contacts updateContact includes the required metadata.sources[].etag; Google Slides removes the unsupported GIF thumbnail MIME type; Google Sheets exposes the previously registered but unreachable delete-rows/sheet/spreadsheet operations in the V2 block.
  • Custom Search: throws on API errors instead of returning empty results; num is numeric-coerced and capped at 10; pagemap typed as unknown; a nextPageStartIndex pagination output is surfaced.

Confidence Score: 5/5

Safe to merge — all changes are backwards-compatible additions or targeted correctness fixes with no removed fields or renamed IDs.

The new Pollen and Solar tools are self-contained with proper error handling. Every bug fix (Ads version, Groups credential forwarding, JSON body serialization, Contacts etag, Slides MIME type, Sheets delete-op wiring) addresses a documented real failure, and the changes are consistent with the existing patterns in the codebase. TypeScript compiles cleanly and check:api-validation passes per the PR description.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/tools/google_maps/pollen.ts New Pollen Forecast tool with correct error guarding, lat/lng URL encoding, and full type-safe response transformation.
apps/sim/tools/google_maps/solar.ts New Solar Potential tool with correct error guarding and structured response mapping; all Solar API fields are surfaced.
apps/sim/tools/google/search.ts Adds 10 new optional search params, throws on API errors, safely coerces and caps num, and surfaces nextPageStartIndex for pagination.
apps/sim/blocks/blocks/google_groups.ts Fixes OAuth credential forwarding — 11 operations changed from credential: oauthCredential to the correct shorthand oauthCredential.
apps/sim/tools/google_groups/update_settings.ts Body is now JSON.stringify'd and description for whoCanViewMessages/whoCanBanUsers corrected to match live API values.
apps/sim/tools/google_contacts/update.ts Adds metadata.sources[{type:'CONTACT', etag}] to the PATCH body, fixing the 400 error from the People API on every update.
apps/sim/blocks/blocks/google_sheets.ts Exposes delete_rows/delete_sheet/delete_spreadsheet in the V2 block UI with correct input parsing and error messaging.
apps/sim/tools/google_slides/get_thumbnail.ts Removes unsupported GIF MIME type from the thumbnail tool; PNG is the only value the Slides API accepts.
apps/sim/blocks/blocks/google_maps.ts Pollen and Solar operations added to the Maps block; shared aqLatitude/aqLongitude fields correctly mapped to lat/lng for both new tools.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph "New Tools"
        P[google_maps_pollen\nPollen Forecast]
        S[google_maps_solar\nSolar Potential]
    end

    subgraph "Expanded Tools"
        CS[google_search\nCustom Search\n+10 params, error throwing\nnextPageStartIndex]
    end

    subgraph "Bug Fixes"
        ADS[google_ads/*\nv19 to v24]
        GG[google_groups/*\ncredential to oauthCredential\nJSON.stringify bodies]
        GC[google_contacts/update\nadd metadata.sources etag]
        GS[google_slides/get_thumbnail\nremove GIF mime type]
        GSH[google_sheets V2 block\nwire delete_rows/sheet/spreadsheet]
    end

    subgraph "Block/Registry"
        REG[tools/registry.ts\n+pollen, +solar]
        MAPS[blocks/google_maps.ts\n+pollen, +solar ops]
        SHEETS[blocks/google_sheets.ts\n+delete ops]
        GROUPS[blocks/google_groups.ts\noauthCredential fix]
    end

    P --> REG
    S --> REG
    P --> MAPS
    S --> MAPS
    GSH --> SHEETS
    GG --> GROUPS
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    subgraph "New Tools"
        P[google_maps_pollen\nPollen Forecast]
        S[google_maps_solar\nSolar Potential]
    end

    subgraph "Expanded Tools"
        CS[google_search\nCustom Search\n+10 params, error throwing\nnextPageStartIndex]
    end

    subgraph "Bug Fixes"
        ADS[google_ads/*\nv19 to v24]
        GG[google_groups/*\ncredential to oauthCredential\nJSON.stringify bodies]
        GC[google_contacts/update\nadd metadata.sources etag]
        GS[google_slides/get_thumbnail\nremove GIF mime type]
        GSH[google_sheets V2 block\nwire delete_rows/sheet/spreadsheet]
    end

    subgraph "Block/Registry"
        REG[tools/registry.ts\n+pollen, +solar]
        MAPS[blocks/google_maps.ts\n+pollen, +solar ops]
        SHEETS[blocks/google_sheets.ts\n+delete ops]
        GROUPS[blocks/google_groups.ts\noauthCredential fix]
    end

    P --> REG
    S --> REG
    P --> MAPS
    S --> MAPS
    GSH --> SHEETS
    GG --> GROUPS
Loading

Reviews (4): Last reviewed commit: "fix(google_search): clamp num to 1-10 an..." | Re-trigger Greptile

The Solar API ImageryQuality enum is HIGH/MEDIUM/BASE (+ UNSPECIFIED) per the
live docs; there is no LOW. Selecting "Low" sent requiredQuality=LOW which the
API rejects as INVALID_ARGUMENT, and the valid BASE tier was unreachable.
Replace LOW with BASE in the tool param/output descriptions, the type union,
and the block dropdown.
Comment thread apps/sim/tools/google_maps/pollen.ts Outdated
Comment thread apps/sim/tools/google_maps/solar.ts Outdated
Comment thread apps/sim/tools/google_maps/pollen.ts
…r channels

Address Greptile review:
- Pollen and Solar transformResponse now check !response.ok || data.error
  (matches the Custom Search fix); a gateway error without an error key in the
  body no longer returns empty/zeroed output silently.
- Pollen color channels use ?? instead of || so a legitimate 0 isn't treated
  as missing (consistent with the other numeric fields in the file).
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/google_maps.ts
Address Cursor Bugbot: a non-numeric `days` input parsed to NaN and was
forwarded as `days=NaN` (the tool's `?? 1` only catches undefined, not NaN),
breaking the forecast call. The block now coerces invalid input to undefined,
and the tool defaults to 1 unless `days` is a finite number.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/google_maps/pollen.ts
Comment thread apps/sim/blocks/blocks/google_groups.ts Outdated
…ttings fields

Address Cursor Bugbot:
- Pollen: clamp days to the documented 1-5 range (truncating fractionals) so 0,
  negatives, or >5 can't be sent to the API.
- Google Groups update_settings: the block has no dedicated settings subblocks,
  so forwarding name/description from params could leak stale values from
  create_group/update_group and unintentionally rename the group. Forward only
  oauthCredential + groupEmail from the block (the tool's own param schema still
  exposes the settings fields for the agent path).
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/google_sheets.ts
Address Cursor Bugbot: delete_sheet/delete_rows parsed deleteSheetId/startIndex/
endIndex with Number.parseInt but didn't validate, so non-numeric UI input became
NaN and was forwarded (the v2 delete tools only reject null/undefined), breaking
the batchUpdate. The block now throws a clear error when any of these is not a
valid number.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/google.ts
Address Cursor Bugbot: num was coerced with Number() but not bounded, so values
like 11 or fractionals reached the API and failed. The tool now truncates and
clamps num to the documented 1-10 range and only sends a positive integer start,
ignoring non-numeric/out-of-range input.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f978967. Configure here.

@waleedlatif1 waleedlatif1 merged commit 11e2313 into staging Jun 17, 2026
16 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/google-integrations-audit branch June 17, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant