Skip to content

feat(tools): add search_people tool#157

Merged
stickerdaniel merged 3 commits intostickerdaniel:mainfrom
ConnorMoss02:feat/search-people
Feb 20, 2026
Merged

feat(tools): add search_people tool#157
stickerdaniel merged 3 commits intostickerdaniel:mainfrom
ConnorMoss02:feat/search-people

Conversation

@ConnorMoss02
Copy link
Copy Markdown
Contributor

@ConnorMoss02 ConnorMoss02 commented Feb 20, 2026

Really enjoyed digging into this codebase and hope to keep contributing — great project.

This adds a search_people tool for searching LinkedIn people by keywords and optional location filter.

Hat tip to #152 by @danmunz which identified this as a missing tool and inspired this implementation. I borrowed the only_first_degree URL parameter idea from that PR but ultimately took a different approach — implementing directly on LinkedInExtractor using the existing innerText extraction pattern rather than introducing the linkedin_scraper dependency. This keeps the tool consistent with the rest of the codebase and maintains the separation between the scraping layer (extractor.py) and the tool registration layer (tools/person.py).

Note: only_first_degree filtering was intentionally left out of this PR — wanted to ship the core feature first and tackle that in a follow-up once the member ID scoping requirement is solved properly.

Changes

  • scraping/extractor.py — added search_people() method alongside search_jobs()
  • tools/person.py — registered search_people tool inside register_person_tools()
  • tests/test_tools.py — added test_search_people and search_people mock to _make_mock_extractor
  • AGENTS.md — added search_people to the Available MCP Tools table

Greptile Summary

Adds a search_people tool for searching LinkedIn people by keywords with optional location filtering. The implementation follows the exact same pattern as the existing search_jobs tool - adding a search_people() method to LinkedInExtractor that constructs the search URL with properly encoded parameters and extracts the results page using the established innerText extraction pattern. Tool registration in person.py includes proper annotations, authentication, error handling, and progress reporting. All documentation files (README.md, AGENTS.md, docs/docker-hub.md) have been updated per the development workflow requirements.

  • Clean implementation that maintains architectural consistency with existing search tools
  • Proper URL parameter encoding using quote_plus()
  • Comprehensive tool-level test coverage added
  • Note: There are existing review comments about missing unit test in test_scraping.py and README.md tool table entry - these appear to be addressed or acknowledged

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is a straightforward feature addition that follows established patterns perfectly. The code mirrors the existing search_jobs implementation almost identically, uses proper URL encoding, includes comprehensive test coverage at the tool level, and updates all required documentation. No security concerns, no breaking changes, and no logic issues detected.
  • No files require special attention

Important Files Changed

Filename Overview
linkedin_mcp_server/scraping/extractor.py Added search_people() method following exact pattern of search_jobs() - clean implementation with proper URL encoding and consistent return structure
linkedin_mcp_server/tools/person.py Registered search_people tool with proper annotations, error handling, and progress reporting - mirrors search_jobs pattern perfectly
tests/test_tools.py Added comprehensive tool-level test for search_people and mock support - though unit test for extractor method in test_scraping.py is still needed per existing comment

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AI calls search_people with keywords and location] --> B[Ensure user is authenticated]
    B --> C[Get or create browser instance]
    C --> D[Create LinkedInExtractor]
    D --> E[Build search URL with encoded parameters]
    E --> F[Navigate to LinkedIn people search page]
    F --> G[Extract page innerText]
    G --> H{Text extracted?}
    H -->|Yes| I[Add to search_results section]
    H -->|No| J[Return empty sections]
    I --> K[Return result with url, sections, pages_visited]
    J --> K
Loading

Last reviewed commit: 1e75f36

Context used:

  • Context from dashboard - CLAUDE.md (source)

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@stickerdaniel stickerdaniel merged commit 9749577 into stickerdaniel:main Feb 20, 2026
5 checks passed
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.

2 participants