Skip to content

improvement(peopledatalabs): add titlecase, placeholders, and 404 handling on search - #4519

Merged
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/mothership-chat-perf
May 8, 2026
Merged

improvement(peopledatalabs): add titlecase, placeholders, and 404 handling on search#4519
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/mothership-chat-perf

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add titlecase boolean param across the 6 PDL endpoints that document it: Person Enrich/Identify/Search, Company Enrich/Search, Autocomplete
  • Add example placeholders to First Name, Last Name, PDL Company ID, and Postal Code subBlocks for clearer UI hints
  • Return empty results on 404 from Person Search and Company Search instead of throwing — matches the pattern used by every other PDL tool

Type of Change

  • Improvement

Testing

Tested manually. bun run check:api-validation and typecheck pass.

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)

@vercel

vercelBot commented May 8, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedMay 8, 2026 8:11pm

Request Review

@cursor

cursorBot commented May 8, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Low risk: changes are limited to People Data Labs tool parameter wiring and response handling, with a small behavior change where person_search/company_search now return empty results on 404 instead of throwing.

Overview
Adds a new advanced titlecase switch/param across supported People Data Labs operations (person/company enrich, person/company search, person identify, autocomplete) and threads it through to the underlying API requests and TypeScript types.

Improves the PDL block UI with clearer example placeholders for several inputs, and updates person_search/company_search to treat 404 responses as a successful empty result set rather than an error.

Reviewed by Cursor Bugbot for commit 15ae417. Configure here.

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the PeopleDataLabs integration with three improvements: titlecase boolean parameter support across all six documented PDL endpoints, example placeholder text for four UI subBlocks, and graceful 404 handling on the Person Search and Company Search tools.

  • titlecase param: Added to the params interface, tool config, and request serialization of all six endpoints (person_enrich, person_identify, person_search, company_enrich, company_search, autocomplete). The block-level transformParams guard correctly strips the param for any operation that doesn't support it.
  • Placeholders: Four cosmetic subBlock fields (first_name, last_name, pdl_id, identify_postal_code) gain example hint text with no logic changes.
  • 404 handling: person_search and company_search now detect a 404 status (checked via data.status ?? response.status, consistent with PDL's JSON envelope format) and return { total: 0, scroll_token: null, results: [] } rather than throwing, matching the success-path shape and the existing pattern across other PDL tools.

Confidence Score: 5/5

Safe to merge — all three changes are narrow and well-scoped, with no impact on existing workflows that don't use the new params.

The titlecase additions are purely additive optional parameters; the 404 early-returns are consistent with the established tool pattern and are type-safe against PdlPersonSearchResponse / PdlCompanySearchResponse; the placeholder strings are UI-only cosmetics. No existing behaviour is changed for callers that omit the new param.

No files require special attention.

Important Files Changed

FilenameOverview
apps/sim/tools/peopledatalabs/person_search.tsAdds titlecase query param to POST body and 404 early-return; logic and types are correct.
apps/sim/tools/peopledatalabs/company_search.tsSame titlecase + 404 pattern as person_search; matches PdlCompanySearchResponse type (scroll_token: string
apps/sim/blocks/blocks/peopledatalabs.tsAdds titlecase switch subBlock, four placeholder strings, and transformParams cleanup guard for non-supported operations.
apps/sim/tools/peopledatalabs/types.tsAdds optional titlecase?: boolean to all six param interfaces; no type regressions.
apps/sim/tools/peopledatalabs/person_enrich.tsAdds titlecase as query-string param; follows existing optional-param pattern correctly.
apps/sim/tools/peopledatalabs/person_identify.tsAdds titlecase as query-string param alongside existing optional params; clean addition.
apps/sim/tools/peopledatalabs/company_enrich.tsAdds titlecase to query-string params; consistent with other GET-based enrich tools.
apps/sim/tools/peopledatalabs/autocomplete.tsAdds titlecase to autocomplete query params; consistent with PDL API docs.

Sequence Diagram

sequenceDiagram
participant UI as Block UI
participant Block as peopledatalabs.ts (transformParams)
participant Tool as person_search / company_search tool
participant PDL as PDL API
UI->>Block: "params (incl. titlecase=true)"
Block->>Block: strip titlecase if op not in supported list
Block->>Tool: cleaned params
Tool->>PDL: "POST /v5/person/search { sql, titlecase: true }"
alt HTTP 200 — results found
PDL-->>Tool: "{ status: 200, data: [...], total: N }"
Tool-->>UI: "{ success: true, output: { total, scroll_token, results } }"
else HTTP 404 — no match
PDL-->>Tool: "{ status: 404, error: { message: 'No records found' } }"
Tool->>Tool: "data.status ?? response.status === 404"
Tool-->>UI: "{ success: true, output: { total: 0, scroll_token: null, results: [] } }"
else Other error (4xx/5xx)
PDL-->>Tool: "{ status: 4xx, error: { message: '...' } }"
Tool-->>UI: throws Error(message)
end
Loading

Reviews (1): Last reviewed commit: "improvement(peopledatalabs): add titleca..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit 3c33c20 into stagingMay 8, 2026
14 checks passed
@waleedlatif1
waleedlatif1 deleted the waleedlatif1/mothership-chat-perf branch May 8, 2026 20:17
Sign up for freeto 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

@waleedlatif1