feat(network): Add invitation manager tools#391
Draft
Aseran20 wants to merge 1 commit into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inreferencesso callers can chainget_person_profile/connect_with_personnaturally.Implementation Notes
get_inboxpattern:_navigate_to_page→_wait_for_main_text→handle_modal_close→_scroll_main_scrollable_region→_extract_root_content(['main'])→strip_linkedin_noise→build_references. No new helpers, no class-name selectors.limitdefaults to 50 (versus 20 forget_inbox) since invitation lists tend to be longer-lived; capped at 100 viaField(ge=1, le=100).tools/network.pymodule to keep them distinct from messaging.server.pyis updated to register them;tests/test_tools.pygets matching mock entries plus aTestNetworkToolsclass and the new tool names in the global timeout assertion.Verification
uv run ruff check .: cleanuv run ruff format .: cleanuv run ty check: cleanuv 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).TestNetworkToolscovers success path for both tools plus a custom-limit forwarding test.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
Generated with Claude Opus 4.7 (1M context).