Skip to content

fix(vercel): align integration with live Vercel REST API docs#5370

Merged
waleedlatif1 merged 8 commits into
stagingfrom
worktree-vercel-validate-integration
Jul 2, 2026
Merged

fix(vercel): align integration with live Vercel REST API docs#5370
waleedlatif1 merged 8 commits into
stagingfrom
worktree-vercel-validate-integration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Ran a full /validate-integration audit of all 63 Vercel tools + block against Vercel's live REST API docs and OpenAPI spec
  • Added missing teamId/slug team-scoping params to 29 tools across deployments, checks, projects, and env vars
  • Added DNS SRV/HTTPS record support to create/update DNS record tools (nested srv/https objects, matching Vercel's discriminated-union schema)
  • Added decrypt/gitBranch filters to get_env_vars, autoUpdate to rerequest_check, redirect to create_alias, comment to create_dns_record
  • Added missing customNameservers/userId/teamId/transferStartedAt fields to list_domains output
  • Wired previously-unexposed tool params into the block UI (pagination filters, gitSource, forceNew, withGitRepoInfo, externalId, rerequestable, output, etc.) so users can actually set them
  • Fixed a duplicate subBlock id collision (projectId used by two unrelated operations) and a bug hiding the team-scope field for check operations
  • Audited the full Vercel API surface for missing endpoint families — nothing else rose to "add now" (log drains/certs/edge-cache-purge/project-members are moderate value but out of scope for this pass)

Type of Change

  • Bug fix

Testing

Tested manually — full monorepo tsc --noEmit and bun run lint pass clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

- add missing teamId/slug scoping to 29 tools (deployments, checks, projects, env vars)
- add DNS SRV/HTTPS record support (nested srv/https objects) to create/update_dns_record
- add decrypt/gitBranch filters to get_env_vars, autoUpdate to rerequest_check
- add redirect param to create_alias, comment to create_dns_record
- add missing customNameservers/userId/teamId/transferStartedAt fields to list_domains output
- wire pagination filters (limit/since/until/search/app) into block subBlocks for list_deployments, list_teams, list_team_members, list_dns_records, list_project_domains
- wire previously-unexposed tool params into block UI: withGitRepoInfo, gitSource, forceNew, externalId, rerequestable, output, direction, follow
- fix duplicate projectId subBlock id collision between list_deployments and other project-scoped operations
- fix teamId scope field incorrectly hidden for check operations
@vercel

vercel Bot commented Jul 2, 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 Jul 2, 2026 5:06pm

Request Review

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Wide surface area across deployments, DNS, and env vars (including optional decrypt of secrets) with many param-mapping changes; mistakes could mis-scope team requests or send wrong record shapes, though changes are additive API alignment rather than auth redesign.

Overview
Brings the Vercel block and tools in line with the live REST API: many operations that already existed in code now expose the right query/body fields and block UI controls.

Team scoping: Optional slug (team slug) is added across Vercel tools as an alternative to teamId, and the block maps Team Slug (Scope) into API calls. Team-scope visibility is fixed so check and most resource operations can set team context.

Block UI & param wiring: Renames the list-deployments project filter to deploymentsProjectId (fixes a duplicate projectId subBlock id). Adds advanced fields for pagination/filters (deployments, projects from/nextFrom, teams/members), deployment options (gitSource, forceNew, events), env vars (decrypt, git branch, comment), checks (externalId, rerequestable, output, autoUpdate), aliases (redirect), and project create/update (rootDirectory, nodeVersion, devCommand, rename on update). Add project domain now shares redirect/git-branch fields with update.

DNS: Create/update DNS tools support SRV and HTTPS via nested srv/https bodies; the block shows type-conditional fields and hides plain value for those types.

Tool-layer fixes: get_env_vars gains decrypt/gitBranch; create_alias sends redirect; list_domains returns extra fields; list projects exposes nextFrom; DNS/env/project types updated accordingly.

Reviewed by Cursor Bugbot for commit 7b1fe84. Configure here.

Comment thread apps/sim/tools/vercel/update_dns_record.ts
@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR audits and aligns the Vercel integration's 63 tools against the live Vercel REST API, adding missing team-scoping params (teamId/slug) to 29 tools, DNS SRV/HTTPS record support with properly nested body schemas, and wiring previously-hidden tool parameters into the block UI.

  • Team scoping: Adds slug query param alongside teamId to nearly all tools; the block handler injects it into base so operations inherit it without per-case boilerplate.
  • DNS SRV/HTTPS: Both create_dns_record and update_dns_record tools build discriminated srv/https sub-objects in the request body when the record type matches, with the block UI conditionally surfacing the relevant fields.
  • Block UI expansion: Fixes a duplicate projectId subBlock ID, exposes pagination (from/limit), gitSource, forceNew, withGitRepoInfo, autoUpdate, decrypt, redirect (alias), externalId, and output inputs that were previously unreachable.

Confidence Score: 5/5

Safe to merge; all changes are additive API-alignment fixes with no breaking changes to existing tool contracts.

The changes are a large but mechanical expansion — adding optional params, fixing a duplicate subBlock ID, and wiring tool fields into the block UI. Each tool correctly builds its URL and body, type coercions are handled consistently (with one minor inconsistency for updateRecordMxPriority that the tool recovers from internally), and tsc --noEmit passes clean. No auth flows, data persistence, or critical execution paths are touched.

apps/sim/blocks/blocks/vercel.ts — the update_dns_record case passes updateRecordMxPriority as a raw string where all other newly-added numeric fields use Number(). Harmless at runtime but worth making consistent.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/vercel.ts Large expansion (+901 lines) wiring new subBlock inputs (SRV/HTTPS DNS fields, pagination filters, gitSource, team-slug, deployment/check params) into the block UI and handler; fixes a duplicate projectId subBlock ID collision and exposes previously inaccessible tool params. Minor inconsistency: updateRecordMxPriority is not wrapped with Number() unlike the other SRV/HTTPS numeric fields added in the same PR.
apps/sim/tools/vercel/types.ts Adds missing type interfaces (SRV/HTTPS DNS fields, gitSource, autoUpdate, decrypt, gitBranch, redirect, pagination fields) and extends existing param/response interfaces with new optional fields; cleanly typed and consistent.
apps/sim/tools/vercel/create_dns_record.ts Adds SRV/HTTPS record support with correct discriminated-union body building (nested srv/https objects), comment field, team-slug query param, and teamId scoping. Type coercions are correct throughout.
apps/sim/tools/vercel/update_dns_record.ts Adds SRV/HTTPS fields mirroring create_dns_record, uses PATCH, and properly nests the srv/https sub-objects only when the record type is explicitly set. mxPriority and ttl are correctly converted via Number() in the body function.
apps/sim/tools/vercel/rerequest_check.ts Adds autoUpdate boolean as a query parameter and team-slug scoping; straightforward and correct.
apps/sim/tools/vercel/list_projects.ts Adds pagination (from, limit), team-slug scoping, and returns nextFrom wrapped in String() for chained pagination.
apps/sim/tools/vercel/list_domains.ts Adds missing customNameservers, userId, teamId, and transferStartedAt to the domain mapping; adds limit and team-slug query params.
apps/sim/tools/vercel/create_alias.ts Adds redirect body field and slug team-scoping query param; body building correctly conditionalises both new fields.
apps/sim/tools/vercel/update_check.ts Adds externalId, output (parsed from JSON string with fallback), and team-slug scoping; correctly handles JSON parsing for the output field.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant UI as Block UI (vercel.ts)
    participant Handler as getParams handler
    participant Tool as Tool (e.g. create_dns_record.ts)
    participant API as Vercel REST API

    UI->>Handler: "{ operation, recordType='SRV', srvTarget, srvWeight, srvPort, srvPriority, teamSlug, ... }"
    Handler->>Handler: "base = { ...rest, apiKey, slug: teamSlug }"
    Handler->>Tool: "{ domain, recordName, recordType='SRV', srvTarget, srvWeight, srvPort, srvPriority }"
    Tool->>Tool: "body.srv = { target, weight, port, priority }"
    Tool->>API: "POST /v2/domains/{domain}/records?teamId=...&slug=..."
    API-->>Tool: "{ uid, updated }"
    Tool-->>UI: "{ success, output: { uid, updated } }"
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"}}}%%
sequenceDiagram
    participant UI as Block UI (vercel.ts)
    participant Handler as getParams handler
    participant Tool as Tool (e.g. create_dns_record.ts)
    participant API as Vercel REST API

    UI->>Handler: "{ operation, recordType='SRV', srvTarget, srvWeight, srvPort, srvPriority, teamSlug, ... }"
    Handler->>Handler: "base = { ...rest, apiKey, slug: teamSlug }"
    Handler->>Tool: "{ domain, recordName, recordType='SRV', srvTarget, srvWeight, srvPort, srvPriority }"
    Tool->>Tool: "body.srv = { target, weight, port, priority }"
    Tool->>API: "POST /v2/domains/{domain}/records?teamId=...&slug=..."
    API-->>Tool: "{ uid, updated }"
    Tool-->>UI: "{ success, output: { uid, updated } }"
Loading

Reviews (8): Last reviewed commit: "fix(vercel): fix silent project-rename l..." | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/vercel.ts
Comment thread apps/sim/blocks/blocks/vercel.ts
- fix withGitRepoInfo 'No' dropdown sending withGitRepoInfo=false instead of omitting the param
- remove redundant duplicate 'Forward' option from eventsDirection dropdown
- fix mxPriority being silently dropped in update_dns_record when record type is left unset
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/vercel.ts
Comment thread apps/sim/tools/vercel/list_projects.ts Outdated
…e UX

- fix list_projects nextFrom being stored as a number despite string typing, which threw TypeError on .trim() when chained into a follow-up list_projects call
- clarify that the DNS update Value field has no effect on existing SRV/HTTPS records unless Record Type is explicitly reselected
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/vercel.ts Outdated
- SRV weight/port/priority, HTTPS priority, and MX priority use truthy checks that silently drop legitimate 0 values; switch to explicit empty/null checks
- add missing MX Priority field to create_dns_record block UI (tool already required it for MX records but there was no way to set it)
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/vercel.ts
Comment thread apps/sim/tools/vercel/update_dns_record.ts
- fix list_deployments/create_deployment/update_check/list_team_members/update_dns_record/update_env_var conditionally spreading into keys that collide with unrelated operations' non-destructured literal subBlock fields (projectId, deploymentId, target, name, search)
- a stale value left over from switching operations in the UI would silently leak into the wrong tool call since the conditional spread only overrides when the current operation's own field has a value
- fix now always assigns these keys directly so they deterministically override any stale base value
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@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 176ca4a. Configure here.

- add missing slug (team-slug) param to 13 domain/DNS/alias tools that were skipped in an earlier fix pass, matching the pattern used everywhere else in this integration
- add rootDirectory, nodeVersion, devCommand params to create_project/update_project (verified against Vercel's live OpenAPI spec — high-value fields for monorepo support and runtime pinning)
- surface rootDirectory/nodeVersion in get_project/list_projects outputs, since the API already returns them
- wire all new fields into the block UI as advanced fields
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/vercel.ts
Comment thread apps/sim/blocks/blocks/vercel.ts
- checkRerequestable, checkAutoUpdate, envVarsDecrypt dropdowns used id: 'false' for their No option (a truthy non-empty string), causing the conditional spread to always fire and explicitly send false instead of omitting the param
- swept the whole file for this pattern; checkBlocking correctly keeps 'false' since it's a required field that's always sent directly, not conditionally
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@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 4d7f749. Configure here.

- update_project had no dedicated rename field and just returned base directly, so a stale value from create_deployment's unrelated 'name' subBlock (Project Name for the deployment) could silently flow through and rename a project on update
- add a dedicated 'New Project Name' field for update_project, wired with a direct override so it always takes precedence over any stale leaked value
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@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 7b1fe84. Configure here.

@waleedlatif1 waleedlatif1 merged commit a267a95 into staging Jul 2, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-vercel-validate-integration branch July 2, 2026 17:39
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