$npx -y skills add cookjohn/gs-skills --skill gs-advanced-searchPerform advanced Google Scholar search with filters - author, journal, date range, exact phrase, title-only. Constructs proper URL parameters from natural language. Use for precise filtered searches.
| 1 | # Google Scholar Advanced Search |
| 2 | |
| 3 | Construct and execute a Google Scholar search using URL parameters based on the user's natural language description. |
| 4 | |
| 5 | ## Arguments |
| 6 | |
| 7 | $ARGUMENTS is a natural language description of the search criteria, e.g.: |
| 8 | - "Search for Einstein's papers on relativity after 2020" |
| 9 | - "Find reviews about CRISPR in Nature" |
| 10 | - "Search for exact phrase 'machine learning' in title only" |
| 11 | |
| 12 | ## Step 1: Parse search criteria into URL parameters |
| 13 | |
| 14 | Map the user's intent to Google Scholar URL parameters: |
| 15 | |
| 16 | | Criteria | Parameter | Example | |
| 17 | |----------|-----------|---------| |
| 18 | | Keywords | `q` | `q=gastric+cancer` | |
| 19 | | Author | `as_sauthors` | `as_sauthors="Albert Einstein"` | |
| 20 | | Journal/Source | `as_publication` | `as_publication=Nature` | |
| 21 | | Start year | `as_ylo` | `as_ylo=2020` | |
| 22 | | End year | `as_yhi` | `as_yhi=2025` | |
| 23 | | Exact phrase | `as_epq` | `as_epq=machine+learning` | |
| 24 | | Any of these words (OR) | `as_oq` | `as_oq=immunotherapy+checkpoint` | |
| 25 | | Exclude words | `as_eq` | `as_eq=review` | |
| 26 | | Search scope | `as_occt` | `as_occt=title` (title only) / `as_occt=any` (anywhere) | |
| 27 | | Results per page | `num` | `num=10` (default) or `num=20` (max) | |
| 28 | | Language | `hl` | `hl=en` or `hl=zh-CN` | |
| 29 | |
| 30 | **Construction examples:** |
| 31 | - "Einstein 2020 年以后在 Nature 上的论文" → `scholar?as_sauthors=Einstein&as_publication=Nature&as_ylo=2020&hl=en` |
| 32 | - "标题包含 CRISPR 的论文" → `scholar?q=CRISPR&as_occt=title&hl=en` |
| 33 | - "精确搜索 'deep learning' 排除 review" → `scholar?as_epq=deep+learning&as_eq=review&hl=en` |
| 34 | - "搜索 immunotherapy 或 checkpoint 相关论文" → `scholar?as_oq=immunotherapy+checkpoint&hl=en` |
| 35 | |
| 36 | **Notes:** |
| 37 | - When `as_sauthors`, `as_publication`, etc. are used, `q` can be omitted or used for additional keywords |
| 38 | - Always include `hl=en` for consistent results |
| 39 | - Use `num=10` (default) to minimize CAPTCHA risk |
| 40 | |
| 41 | ## Step 2: Navigate |
| 42 | |
| 43 | Use `mcp__chrome-devtools__navigate_page`: |
| 44 | - url: `https://scholar.google.com/scholar?{CONSTRUCTED_PARAMS}` |
| 45 | |
| 46 | ## Step 3: Extract results (evaluate_script) |
| 47 | |
| 48 | Same extraction script as gs-search step 2: |
| 49 | |
| 50 | ```javascript |
| 51 | async () => { |
| 52 | for (let i = 0; i < 20; i++) { |
| 53 | if (document.querySelector('#gs_res_ccl') || document.querySelector('#gs_captcha_ccl')) break; |
| 54 | await new Promise(r => setTimeout(r, 500)); |
| 55 | } |
| 56 | |
| 57 | if (document.querySelector('#gs_captcha_ccl') || document.body.innerText.includes('unusual traffic')) { |
| 58 | return { error: 'captcha', message: 'Google Scholar requires CAPTCHA verification. Please complete it in your browser, then tell me to continue.' }; |
| 59 | } |
| 60 | |
| 61 | const items = document.querySelectorAll('#gs_res_ccl .gs_r.gs_or.gs_scl'); |
| 62 | const results = Array.from(items).map((item, i) => { |
| 63 | const titleEl = item.querySelector('.gs_rt a'); |
| 64 | const meta = item.querySelector('.gs_a')?.textContent || ''; |
| 65 | const parts = meta.split(' - '); |
| 66 | const authors = parts[0]?.trim() || ''; |
| 67 | const journalYear = parts[1]?.trim() || ''; |
| 68 | const citedByEl = item.querySelector('.gs_fl a[href*="cites"]'); |
| 69 | |
| 70 | return { |
| 71 | n: i + 1, |
| 72 | title: titleEl?.textContent?.trim() || item.querySelector('.gs_rt')?.textContent?.trim() || '', |
| 73 | href: titleEl?.href || '', |
| 74 | authors, |
| 75 | journalYear, |
| 76 | citedBy: citedByEl?.textContent?.match(/\d+/)?.[0] || '0', |
| 77 | citedByUrl: citedByEl?.href || '', |
| 78 | dataCid: item.getAttribute('data-cid') || '', |
| 79 | fullTextUrl: (item.querySelector('.gs_ggs a') || item.querySelector('.gs_or_ggsm a'))?.href || '', |
| 80 | snippet: item.querySelector('.gs_rs')?.textContent?.trim()?.substring(0, 200) || '' |
| 81 | }; |
| 82 | }); |
| 83 | |
| 84 | const totalText = document.querySelector('#gs_ab_md')?.textContent?.trim() || ''; |
| 85 | const currentUrl = window.location.href; |
| 86 | return { total: totalText, resultCount: results.length, currentUrl, results }; |
| 87 | } |
| 88 | ``` |
| 89 | |
| 90 | ## Step 4: Report |
| 91 | |
| 92 | ``` |
| 93 | Advanced search on Google Scholar: |
| 94 | Query parameters: {list the parameters used} |
| 95 | {total} |
| 96 | |
| 97 | 1. {title} |
| 98 | Authors: {authors} | {journalYear} |
| 99 | Cited by: {citedBy} | [Full text]({fullTextUrl}) |
| 100 | Data-CID: {dataCid} |
| 101 | |
| 102 | 2. ... |
| 103 | ``` |
| 104 | |
| 105 | Always show the constructed URL parameters so the user understands how the query was built. |
| 106 | |
| 107 | ## Notes |
| 108 | |
| 109 | - This skill uses 2 tool calls: `navigate_page` + `evaluate_script` |
| 110 | - Google Scholar does NOT support publication type filtering (review, clinical trial, etc.) — use keywords instead |
| 111 | - Impact factor is not available in Google Scholar — use citation count as a proxy |
| 112 | - The key difference from gs-search is URL parameter construction — this skill translates natural language to Google Scholar query parameters |