Skip to content

feat(job): add get_saved_jobs tool#523

Open
alfonzeta wants to merge 2 commits into
stickerdaniel:mainfrom
alfonzeta:feature/522-get-saved-jobs
Open

feat(job): add get_saved_jobs tool#523
alfonzeta wants to merge 2 commits into
stickerdaniel:mainfrom
alfonzeta:feature/522-get-saved-jobs

Conversation

@alfonzeta

@alfonzeta alfonzeta commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • Adds get_saved_jobs MCP tool to list job postings saved by the authenticated user at /my-items/saved-jobs/
  • Returns {url, sections: {saved_jobs}, job_ids, references?} compatible with existing get_job_details
  • Supports pagination via max_pages (1–10, default 3) using ?start= offsets
  • Locale-independent extraction: innerText + a[href*="/jobs/view/"] job ID parsing

Closes #522

Synthetic prompt

Add get_saved_jobs tool following the search_jobs pattern: navigate to /my-items/saved-jobs/, extract innerText and job IDs with pagination, register in tools/job.py, add tests and update README, docker-hub.md, and manifest.json.

Test plan

  • uv run pytest tests/test_scraping.py::TestGetSavedJobs
  • uv run pytest tests/test_tools.py::TestJobTools::test_get_saved_jobs
  • Live verification against authenticated session (get_saved_jobs(max_pages=2) returned 20 job IDs across 2 pages)
  • Maintainer review on non-English LinkedIn locale (extraction is locale-independent by design)

alfonzeta and others added 2 commits June 19, 2026 22:49
List authenticated user's saved job postings from /my-items/saved-jobs/ with pagination and job_ids for get_job_details chaining.

Closes stickerdaniel#522

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a saved-jobs tool for LinkedIn job workflows. The main changes are:

  • New get_saved_jobs MCP tool registration.
  • Saved-jobs scraping and job ID extraction from /my-items/saved-jobs/.
  • Pagination, diagnostics, docs, manifest, and tests for the new tool.

Confidence Score: 4/5

This is close, but the saved-jobs pagination should be fixed before merging.

  • The new tool can return incomplete saved-job results for users with more than one saved-jobs page.
  • The wrapper, diagnostics, docs, and manifest changes look consistent with the existing job tools.

linkedin_mcp_server/scraping/extractor.py

Important Files Changed

Filename Overview
linkedin_mcp_server/scraping/extractor.py Adds the saved-jobs extractor and pagination logic, including the offset issue that can skip saved jobs.
linkedin_mcp_server/tools/job.py Registers the new MCP tool wrapper and forwards max_pages to the extractor.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
linkedin_mcp_server/scraping/extractor.py:3376-3380
**Use saved-jobs offset** The saved-jobs path reuses `_PAGE_SIZE = 25` from job search, but the PR's live check says two saved-job pages returned 20 IDs, so this list paginates in 10-item pages. With `max_pages=2`, the second request jumps to `?start=25`, skipping saved jobs at offsets 10 through 24 and returning an incomplete list for anyone with more than one page of saved jobs.

```suggestion
            saved_jobs_page_size = 10
            url = (
                base_url
                if page_num == 0
                else f"{base_url}?start={page_num * saved_jobs_page_size}"
            )
```

Reviews (1): Last reviewed commit: "style: ruff format saved jobs warning lo..." | Re-trigger Greptile

Comment on lines +3376 to +3380
url = (
base_url
if page_num == 0
else f"{base_url}?start={page_num * _PAGE_SIZE}"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Use saved-jobs offset The saved-jobs path reuses _PAGE_SIZE = 25 from job search, but the PR's live check says two saved-job pages returned 20 IDs, so this list paginates in 10-item pages. With max_pages=2, the second request jumps to ?start=25, skipping saved jobs at offsets 10 through 24 and returning an incomplete list for anyone with more than one page of saved jobs.

Suggested change
url = (
base_url
if page_num == 0
else f"{base_url}?start={page_num * _PAGE_SIZE}"
)
saved_jobs_page_size = 10
url = (
base_url
if page_num == 0
else f"{base_url}?start={page_num * saved_jobs_page_size}"
)
Prompt To Fix With AI
This is a comment left during a code review.
Path: linkedin_mcp_server/scraping/extractor.py
Line: 3376-3380

Comment:
**Use saved-jobs offset** The saved-jobs path reuses `_PAGE_SIZE = 25` from job search, but the PR's live check says two saved-job pages returned 20 IDs, so this list paginates in 10-item pages. With `max_pages=2`, the second request jumps to `?start=25`, skipping saved jobs at offsets 10 through 24 and returning an incomplete list for anyone with more than one page of saved jobs.

```suggestion
            saved_jobs_page_size = 10
            url = (
                base_url
                if page_num == 0
                else f"{base_url}?start={page_num * saved_jobs_page_size}"
            )
```

How can I resolve this? If you propose a fix, please make it concise.

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.

[FEATURE] Add get_saved_jobs tool to fetch authenticated user's saved job postings

1 participant