Skip to content

feat(network): Add invitation manager tools#391

Draft
Aseran20 wants to merge 1 commit into
stickerdaniel:mainfrom
Aseran20:feature/390-invitation-manager-tools
Draft

feat(network): Add invitation manager tools#391
Aseran20 wants to merge 1 commit into
stickerdaniel:mainfrom
Aseran20:feature/390-invitation-manager-tools

Conversation

@Aseran20
Copy link
Copy Markdown

Closes #390.

Summary

Adds two new read-only MCP tools that surface the LinkedIn invitation manager:

  • get_sent_invitations — outgoing connection requests still awaiting acceptance (/mynetwork/invitation-manager/sent/)
  • get_received_invitations — incoming connection requests awaiting your action (/mynetwork/invitation-manager/)

Both return the standard {url, sections, references} shape, with anchor-derived profile URLs in references so callers can chain get_person_profile / connect_with_person naturally.

Implementation Notes

  • Both extractor methods mirror the get_inbox pattern: _navigate_to_page_wait_for_main_texthandle_modal_close_scroll_main_scrollable_region_extract_root_content(['main'])strip_linkedin_noisebuild_references. No new helpers, no class-name selectors.
  • limit defaults to 50 (versus 20 for get_inbox) since invitation lists tend to be longer-lived; capped at 100 via Field(ge=1, le=100).
  • Network-graph operations land in a new tools/network.py module to keep them distinct from messaging. server.py is updated to register them; tests/test_tools.py gets matching mock entries plus a TestNetworkTools class and the new tool names in the global timeout assertion.
  • README tool status table updated.

Verification

  • uv run ruff check .: clean
  • uv run ruff format .: clean
  • uv run ty check: clean
  • uv run pytest: 385 passed, 5 skipped (Windows POSIX-permission skips), 2 pre-existing Docker-runtime failures unrelated to this change (verified by checking out main and reproducing).
  • New unit tests: TestNetworkTools covers success path for both tools plus a custom-limit forwarding test.
  • Live end-to-end against mynetwork/invitation-manager/sent/ not run in this PR; happy to follow the AGENTS.md curl-based protocol if a maintainer wants me to capture a sample payload before merge.

Synthetic prompt

Add two new MCP tools, get_sent_invitations and get_received_invitations, exposing the LinkedIn invitation manager pages (sent and received). Place them in a new tools/network.py module to keep them distinct from messaging. Mirror the get_inbox extractor pattern (navigate → scroll → extract → build_references). Wire registration in server.py, extend the test mock and add TestNetworkTools covering success + custom limit, update the README tool status table, and update the global timeout assertion to include the new tool names.

Generated with Claude Opus 4.7 (1M context).

Add get_sent_invitations and get_received_invitations tools to expose
the LinkedIn invitation manager pages. Outgoing requests live at
/mynetwork/invitation-manager/sent/, incoming requests at
/mynetwork/invitation-manager/. Both follow the established
get_inbox-style pattern: navigate, scroll, extract main innerText,
build references via the standard anchor pipeline.

Network-graph operations land in a new tools/network.py module to keep
them distinct from messaging.

Closes stickerdaniel#390
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_sent_invitations and get_received_invitations tools

1 participant