$npx -y skills add cookjohn/gs-skills --skill gs-fulltextGet full-text access links for a Google Scholar paper - PDF, DOI, Sci-Hub, and publisher links. Use when user wants to read or download a paper's full text.
| 1 | # Google Scholar Full Text Access |
| 2 | |
| 3 | Resolve and present all full-text access options for a paper found in Google Scholar search results. |
| 4 | |
| 5 | ## Arguments |
| 6 | |
| 7 | $ARGUMENTS can be: |
| 8 | - A `data-cid` from a previous search result |
| 9 | - A result number (e.g., `3`) referring to a previous search result |
| 10 | |
| 11 | ## Prerequisites |
| 12 | |
| 13 | This skill works best after a previous `gs-search` or `gs-advanced-search` call, which already extracts `fullTextUrl` and `href` for each result. If those are available, use them directly. |
| 14 | |
| 15 | ## Steps |
| 16 | |
| 17 | ### Step 1: Collect links from search results |
| 18 | |
| 19 | From the previous search result, extract these fields for the target paper: |
| 20 | - `fullTextUrl`: direct PDF/HTML link (from `.gs_ggs a`) |
| 21 | - `href`: link to the paper's publisher page (from `.gs_rt a`) |
| 22 | - `dataCid`: cluster ID |
| 23 | |
| 24 | If no previous search context is available, search for the paper first using `gs-search`. |
| 25 | |
| 26 | ### Step 2: Resolve additional links (evaluate_script) |
| 27 | |
| 28 | Navigate to the Google Scholar results page (if not already there), then extract full-text links for the specific paper: |
| 29 | |
| 30 | ```javascript |
| 31 | async () => { |
| 32 | const cid = "DATA_CID_HERE"; |
| 33 | |
| 34 | // Find the result item by data-cid |
| 35 | const item = document.querySelector(`.gs_r.gs_or.gs_scl[data-cid="${cid}"]`); |
| 36 | if (!item) return { error: 'not_found', message: 'Paper not found on current page. Try searching again.' }; |
| 37 | |
| 38 | const titleEl = item.querySelector('.gs_rt a'); |
| 39 | const title = titleEl?.textContent?.trim() || item.querySelector('.gs_rt')?.textContent?.trim() || ''; |
| 40 | const paperUrl = titleEl?.href || ''; |
| 41 | |
| 42 | // Full-text PDF/HTML link (shown on the right side of results) |
| 43 | const fullTextEl = item.querySelector('.gs_ggs a') || item.querySelector('.gs_or_ggsm a'); |
| 44 | const fullTextUrl = fullTextEl?.href || ''; |
| 45 | const fullTextType = fullTextEl?.querySelector('span.gs_ctg2')?.textContent?.trim() || ''; |
| 46 | |
| 47 | // Meta info for context |
| 48 | const meta = item.querySelector('.gs_a')?.textContent || ''; |
| 49 | const parts = meta.split(' - '); |
| 50 | const authors = parts[0]?.trim() || ''; |
| 51 | const journalYear = parts[1]?.trim() || ''; |
| 52 | |
| 53 | // Try to extract DOI from paper URL |
| 54 | let doi = ''; |
| 55 | if (paperUrl.includes('doi.org/')) { |
| 56 | doi = paperUrl.replace(/^https?:\/\/(dx\.)?doi\.org\//, ''); |
| 57 | } |
| 58 | |
| 59 | // Build access links |
| 60 | const links = {}; |
| 61 | |
| 62 | if (fullTextUrl) { |
| 63 | links.fullText = fullTextUrl; |
| 64 | links.fullTextType = fullTextType || (fullTextUrl.endsWith('.pdf') ? '[PDF]' : '[HTML]'); |
| 65 | } |
| 66 | |
| 67 | if (paperUrl) { |
| 68 | links.publisher = paperUrl; |
| 69 | } |
| 70 | |
| 71 | if (doi) { |
| 72 | links.doi = `https://doi.org/${doi}`; |
| 73 | links.scihub = `https://sci-hub.ru/${doi}`; |
| 74 | } else if (paperUrl) { |
| 75 | // Sci-Hub also works with direct URLs |
| 76 | links.scihub = `https://sci-hub.ru/${paperUrl}`; |
| 77 | } |
| 78 | |
| 79 | return { |
| 80 | dataCid: cid, |
| 81 | title, |
| 82 | authors, |
| 83 | journalYear, |
| 84 | doi, |
| 85 | fullTextUrl, |
| 86 | fullTextType, |
| 87 | paperUrl, |
| 88 | links |
| 89 | }; |
| 90 | } |
| 91 | ``` |
| 92 | |
| 93 | ### Step 3: Report |
| 94 | |
| 95 | ``` |
| 96 | ## Full Text Links — {title} |
| 97 | |
| 98 | **Authors:** {authors} | {journalYear} |
| 99 | |
| 100 | **Direct Full Text:** |
| 101 | {links.fullText ? "- " + links.fullTextType + " " + links.fullText : "No direct full text link available"} |
| 102 | |
| 103 | **Publisher Page:** |
| 104 | {links.publisher ? "- " + links.publisher : "N/A"} |
| 105 | |
| 106 | **DOI:** |
| 107 | {links.doi ? "- " + links.doi : "No DOI detected"} |
| 108 | |
| 109 | **Sci-Hub:** |
| 110 | {links.scihub ? "- " + links.scihub : "N/A"} |
| 111 | ``` |
| 112 | |
| 113 | ### Step 4: Open full text (optional) |
| 114 | |
| 115 | If the user wants to read the paper immediately, use `mcp__chrome-devtools__new_page` to open the preferred link in this priority: |
| 116 | 1. `fullTextUrl` (direct PDF/HTML, usually free) |
| 117 | 2. DOI link (may require subscription) |
| 118 | 3. Sci-Hub link (fallback) |
| 119 | 4. Publisher page |
| 120 | |
| 121 | ## Notes |
| 122 | |
| 123 | - This skill uses 1-2 tool calls: `evaluate_script` (if already on results page) or `navigate_page` + `evaluate_script` |
| 124 | - Google Scholar's full-text links (`.gs_ggs`) are usually free/open-access PDFs |
| 125 | - DOI may not always be extractable from the paper URL |
| 126 | - Sci-Hub works with both DOI and direct URL |
| 127 | - Opening full text in a new tab adds 1 more tool call (`new_page`) |