feat(serply): add Serply web search tool and block - #6866
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The new Shape mirrors Serper, but with fewer options (no type/country/language) and the shared Reviewed by Cursor Bugbot for commit cf20804. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryAdds a Serply web-search integration and exposes it as a workflow block.
Confidence Score: 4/5The PR appears safe to merge, with only a non-blocking type-safety cleanup needed in the new integration and its test. The block and tool identifiers align and the request path is wired consistently with existing search integrations; the only accepted concern is explicit Files Needing Attention: apps/sim/tools/serply/search.ts, apps/sim/tools/serply/search.test.ts
|
| Filename | Overview |
|---|---|
| apps/sim/tools/serply/search.ts | Implements the Serply request and result mapping correctly at a high level, but uses an explicit any for response items. |
| apps/sim/blocks/blocks/serply.ts | Defines the Serply block with aligned inputs, outputs, credentials, and registered tool access. |
| apps/sim/tools/serply/search.test.ts | Covers the principal request and mapping behavior, with one explicit any weakening type safety. |
| apps/sim/tools/registry.ts | Registers the new tool under the matching serply_search identifier. |
| apps/sim/blocks/registry-maps.ts | Registers the Serply block and metadata consistently in both block maps. |
Reviews (1): Last reviewed commit: "feat(serply): add Serply web search tool..." | Re-trigger Greptile
| const results = Array.isArray(data.results) ? data.results : [] | ||
|
|
||
| const searchResults: SearchResult[] = results.map((item: any) => ({ | ||
| title: item.title || '', |
There was a problem hiding this comment.
The explicit any removes compiler checks from every Serply result mapping, allowing invalid response assumptions to pass type checking as the integration evolves. Model the response item or narrow it from unknown; the same explicit any pattern also appears in the URL-builder test.
Context Used: TypeScript conventions and type safety (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Fixed in cf20804. transformResponse now parses into declared shapes (SerplySearchApiResponse / SerplyResultItem with optional title/link/description) instead of mapping over any, and the URL-builder test casts to the exported SearchParams rather than any — matching the mem0/memory test convention. No any left in tools/serply/; bun run type-check is clean.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a4129fe. Configure here.
Adds a Serply search tool and block following the existing serper/tavily pattern: GET https://api.serply.io/v1/search/ with an API key header, mapped to organic search results (title, link, snippet). Serply is optional; nothing changes for workflows that do not use it.
Addresses review feedback on the Serply tool. serply_search was registered in tools/registry.ts but missing from the generated artifacts, so hasToolId/getToolParams/getToolMetadata resolved it as unknown and tool-metadata:check failed. Regenerated via tool-metadata:generate; the only delta is the added serply_search entry in each file, no existing tool changed. Replaced the explicit any in transformResponse with declared SerplyResultItem/SerplySearchApiResponse shapes, and typed the URL builder cast in the test as SearchParams.
fbd8730 to
cf20804
Compare

Summary
Adds a Serply (https://serply.io) web search tool and block, following the existing serper/tavily integration pattern.
Closes #6865
serply_search(apps/sim/tools/serply/search.ts):GET https://api.serply.io/v1/search/withX-Api-Keyauth, mapped tosearchResults(title, link, snippet). Serply sits behind Cloudflare, so the request always sends an explicitUser-Agent.SerplyBlock(apps/sim/blocks/blocks/serply.ts) with query, number of results, and API key fields, mirroring the serper block's shape. Uses the sharedSearchicon from@sim/emcn/iconsrather than adding a hand-drawn brand SVG.tools/registry.tsandblocks/registry-maps.ts(BLOCK_REGISTRY+BLOCK_META_REGISTRY, alphabetical).Serply is fully optional. No existing behavior changes for workflows that do not use it, and no
SERPLY_API_KEYis required anywhere.More on the API: https://serply.io/docs
Type of Change
Testing
apps/sim/tools/serply/search.test.ts(4 tests: headers/User-Agent, URL building, result mapping, empty-results case). All pass.bun run type-checkinapps/sim: 0 errors.tools/serper,tools/index.test.ts(164 tests) and all ofblocks/(66 files, 938 tests) pass unchanged.bun run check:api-validationpasses.bunx biome checkclean on all touched files.Checklist
Screenshots/Videos
N/A (no bespoke UI; the block renders through the standard block UI generated from its config)
Disclosure: I work with Serply. Happy to adjust scope, naming, or drop this
entirely if it isn't a direction you want for the project.