Skip to content

[FEATURE] Paginate search_people to retrieve more than 10 results #526

Description

@PierreKasparian

Feature Description

search_people currently returns only the first results page of a LinkedIn people search (~10 results). There is no way to retrieve more. This adds an optional max_pages parameter (1-10, default 1) so callers can paginate through additional pages of results in a single tool call.

Use Case

When searching for people, 10 results is often not enough — e.g. building a shortlist of candidates/recruiters for a given role and location. Today the only way to get more would be additional, unsupported requests. search_jobs already supports max_pages; search_people should offer the same capability for consistency.

Suggested Approach

Mirror the existing search_jobs pagination pattern:

  • Add max_pages: Annotated[int, Field(ge=1, le=10)] = 1 to the search_people tool and the LinkedInExtractor.search_people method.
  • Paginate via LinkedIn's &page=N URL parameter (1-based), looping up to max_pages, with the existing _NAV_DELAY between navigations.
  • Join each page's text into the single search_results section with \n---\n, and dedupe references by URL across pages.
  • Stop early, in a locale-independent way, when a page surfaces no new kind: person references (i.e. we have run past the last page) — so over-requesting pages is harmless.
  • Default max_pages=1 preserves current behavior exactly (opt-in pagination).
  • Update tests, README and manifest.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions