Scrape post comments
Direct LinkedIn read (bypasses our DB): one page of the COMMENTS on ONE post, live. This is the only comments read there is - a row carries the comment AND the person who wrote it (content, posted_at, comment_permalink, reactions_count, replies_count, is_pinned, is_edited + member id, nickname, name, headline), annotated with is_own, so reading “what was written” and “who commented” is a single call and never two. Target any post by URL, activity URN, or the backend urn a company-page post / newsletter issue / group thread carries (share, ugcPost, groupPost) in post. Top-level comments only: replies are not on this wire at all, replies_count is a count. Order with sort_order; one wire page per call, page on with cursor.
Contract:
- MCP tool
scrape_linkedin_get_post_comments, registry packagemcp.linkedin/linkedin_scraping, mountlinkedin.scraping. - Operation
action, response envelopeaction. - Flags: none.
Authorizations
Access token issued by gtm.service.id. Its access_identity claim carries team_sid, actor_sid and actor_type, and that team scope is authoritative.
Team scope for tokens that do not carry one. Ignored when the token already names a team.
Body
Request body of scrape_linkedin_get_post_comments.
The post, named any way you have it. Cheapest is a post urn - urn:li:share:<id>, urn:li:ugcPost:<id> (company-page posts, newsletter issues), urn:li:groupPost:<group>-<post> - because that is what the comment list is actually addressed by. An urn:li:activity:<id>, a feed permalink (/feed/update/urn:li:activity:<id>/) or the share link the copy-link button produces (/posts/<slug>-activity-<id>-<hash>) all work too: the urn is parsed out locally at no cost, then converted to the post urn through one extra read that is cached for 7 days, so only the first call on a given post pays it. A linkedin.com link with no id in it (a bare slug URL) adds one more page load to find the urn. An lnkd.in shortlink is NOT resolvable and is refused 422 post_not_resolvable: expand it yourself first. A post LinkedIn will not name (deleted, or not visible to the executing account) is refused 422 post_urn_not_resolvable. The post does NOT need to be tracked or owned by you.
512Executor account (ln_ac_...). OPTIONAL everywhere on this surface. Given: the call runs on that account ONLY; a saturated or held scraping bucket refuses 429 bucket_saturated (with retry_after). Omitted: the service auto-picks one of your connected accounts with remaining capacity (SN verbs pick only Sales-Navigator seats; 422 no_connected_accounts when none is ready, 429 when all are at capacity).
18^ln_ac_Ledger replay guard: a repeat call with the same (team, key) returns the stored outcome; no re-execution. Recommended on every search run. The KEY ALONE decides: the probe does not compare arguments, so reusing one key after changing the arguments hands back the FIRST result. On the twelve search verbs that matters twice over, because switching a call from filters to url (or back) under one key replays instead of running the new search. New search, new key.
128Default 50; one wire page per call.
1 <= x <= 100Order of the comment list. RELEVANCE is LinkedIn's own default and what you get when this is omitted; REVERSE_CHRONOLOGICAL is "Most recent" in the UI, CHRONOLOGICAL walks oldest-first. Polling a watched post for new comments wants REVERSE_CHRONOLOGICAL, because under relevance a new comment is not guaranteed to be on page 1. A cursor belongs to the order it was issued under - do not resume a walk with a different sort_order.
RELEVANCE, CHRONOLOGICAL, REVERSE_CHRONOLOGICAL Opaque resume token from paging.next_cursor; null = first page.