Skip to content

improvement(brex): fill validate-integration gaps against live API docs#5362

Merged
waleedlatif1 merged 1 commit into
stagingfrom
worktree-brex-validate-integration
Jul 2, 2026
Merged

improvement(brex): fill validate-integration gaps against live API docs#5362
waleedlatif1 merged 1 commit into
stagingfrom
worktree-brex-validate-integration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Ran a full /validate-integration audit on the Brex integration (28 tools + block) against Brex's live REST v2 API docs
  • Added AI-autofill (wandConfig) to the expense/spend-limit advanced-mode filter subBlocks (user IDs, statuses, payment statuses)
  • Surfaced is_ppro_enabled on the get/list transfer tools — confirmed present in Brex's live Transfer schema but previously missing from our output
  • Surfaced start_date/end_date/authorization_settings on list_spend_limits to match what get_spend_limit already exposes for the same resource
  • Confirmed via 6 parallel adversarial re-validation passes: endpoints, methods, params, response mappings, pagination, and block/tool wiring are all correct; no fields removed, fully backwards compatible

Type of Change

  • Improvement

Testing

Tested manually. bun run lint and bun run type-check 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 wandConfig AI-autofill to expense/spend-limit filter subBlocks
- surface is_ppro_enabled on get/list transfer tools
- surface start_date/end_date/authorization_settings on list_spend_limits to match get_spend_limit
@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 6:55am

Request Review

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are optional output metadata and UI autofill prompts only; no request logic or removed fields, so behavior stays backward compatible.

Overview
Brings the Brex integration closer to live API docs with additive tool/type updates and AI wand autofill on several advanced block filters.

The Brex block now has wandConfig on advanced filters for user IDs (expenses/card transactions), expense statuses, payment statuses, and member user IDs (spend limits), so users can describe filters in natural language instead of typing comma-separated API values.

Transfer get and list tools and shared types now expose isPproEnabled / is_ppro_enabled (Principal Protection). list_spend_limits item schemas and BrexSpendLimit now document start_date, end_date, and authorization_settings, matching what get_spend_limit already returns for the same resource.

Reviewed by Cursor Bugbot for commit 0c06301. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fills gaps in the Brex integration by surfacing previously missing API fields and adding AI-autofill (wandConfig) to advanced-mode filter inputs, validated against Brex's live REST v2 API docs.

  • wandConfig on filter subBlocks: Adds AI-autofill config to the userIds, statuses, paymentStatuses, and memberUserIds subBlock inputs in brex.ts, following the same pattern already established for timestamp fields (purchasedAtStart, etc.). Prompts are well-structured with enum values and example mappings.
  • is_ppro_enabled surfaced on transfer tools: Added to BrexTransfer interface, the list_transfers output schema (snake_case passthrough), and get_transfer's transformResponse + output schema (camelCase mapped). The field correctly falls back to null via ?? null in the single-item transform.
  • start_date/end_date/authorization_settings on list_spend_limits: Brings the list tool to parity with get_spend_limit, which already exposed these in camelCase. The new additions use snake_case consistent with the raw-passthrough pattern in list_spend_limits. BrexSpendLimit interface updated accordingly.

Confidence Score: 5/5

All changes are strictly additive — new optional fields in output schemas, new wandConfig on filter subBlocks, and updated TypeScript interfaces — with no modifications to existing fields, request logic, or transformResponse mappings beyond get_transfer's new null-safe assignment.

Every new field follows the established coding patterns: snake_case in raw-passthrough tools (list_transfers, list_spend_limits) and camelCase with explicit null-fallback in the single-item mapped tool (get_transfer). The wandConfig prompts are constrained and self-consistent with the existing timestamp wandConfig pattern. TypeScript interface updates correctly use | null and are reflected in the corresponding response interfaces. No fields removed, no endpoint changes, no breaking surface changes.

No files require special attention. All five changed files are internally consistent and compatible with each other.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/brex.ts Added wandConfig to four advanced-mode filter subBlocks; prompts are well-structured with valid enum values, examples, and strict return-ONLY instructions matching the existing timestamp wandConfig pattern.
apps/sim/tools/brex/get_transfer.ts isPproEnabled correctly mapped from snake_case API field with null-fallback in transformResponse, and declared as optional boolean in outputs schema.
apps/sim/tools/brex/list_transfers.ts is_ppro_enabled added to items output schema using snake_case consistent with the raw-passthrough approach; no transform changes needed.
apps/sim/tools/brex/list_spend_limits.ts start_date, end_date, and authorization_settings added to items output schema, achieving parity with get_spend_limit; raw-passthrough transform correctly exposes these without modification.
apps/sim/tools/brex/types.ts BrexSpendLimit and BrexTransfer interfaces updated to include new fields with correct nullable types; BrexGetTransferResponse output type extended with isPproEnabled boolean

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Block["brex.ts Block (UI)"]
        B1["userIds subBlock - wandConfig added"]
        B2["statuses subBlock - wandConfig added"]
        B3["paymentStatuses subBlock - wandConfig added"]
        B4["memberUserIds subBlock - wandConfig added"]
    end

    subgraph Tools["Tool Layer"]
        T1["get_transfer.ts - isPproEnabled mapped camelCase"]
        T2["list_transfers.ts - is_ppro_enabled output schema"]
        T3["list_spend_limits.ts - start_date, end_date, authorization_settings"]
    end

    subgraph Types["types.ts"]
        TY1["BrexTransfer + is_ppro_enabled"]
        TY2["BrexSpendLimit + start_date, end_date, authorization_settings"]
        TY3["BrexGetTransferResponse + isPproEnabled"]
    end

    subgraph API["Brex REST API"]
        API1["GET /v1/transfers/:id"]
        API2["GET /v1/transfers"]
        API3["GET /v2/spend_limits"]
    end

    B1 --> T2
    B4 --> T3
    T1 --> TY3
    T2 --> TY1
    T3 --> TY2
    T1 --> API1
    T2 --> API2
    T3 --> API3
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 Block["brex.ts Block (UI)"]
        B1["userIds subBlock - wandConfig added"]
        B2["statuses subBlock - wandConfig added"]
        B3["paymentStatuses subBlock - wandConfig added"]
        B4["memberUserIds subBlock - wandConfig added"]
    end

    subgraph Tools["Tool Layer"]
        T1["get_transfer.ts - isPproEnabled mapped camelCase"]
        T2["list_transfers.ts - is_ppro_enabled output schema"]
        T3["list_spend_limits.ts - start_date, end_date, authorization_settings"]
    end

    subgraph Types["types.ts"]
        TY1["BrexTransfer + is_ppro_enabled"]
        TY2["BrexSpendLimit + start_date, end_date, authorization_settings"]
        TY3["BrexGetTransferResponse + isPproEnabled"]
    end

    subgraph API["Brex REST API"]
        API1["GET /v1/transfers/:id"]
        API2["GET /v1/transfers"]
        API3["GET /v2/spend_limits"]
    end

    B1 --> T2
    B4 --> T3
    T1 --> TY3
    T2 --> TY1
    T3 --> TY2
    T1 --> API1
    T2 --> API2
    T3 --> API3
Loading

Reviews (1): Last reviewed commit: "improvement(brex): fill validate-integra..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 5553c44 into staging Jul 2, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-brex-validate-integration branch July 2, 2026 15:29
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