Skip to main content
Glama
xjtlu-library-mcp

xjtlu-library-mcp

by seally-web

browser_download

Download full-text PDFs from anti-bot academic sites by reusing the logged-in Chrome session, with probe-only access checks and clear reasons for blocked, unsubscribed, or invalid links.

Instructions

下载那些普通 HTTP 抓不动的 PDF(Wiley / Taylor & Francis / Oxford Academic / Project Euclid / ScienceDirect 这类有反爬风控的站)。

做法:复用 browser_login 的那个 Chrome —— 打开落地页、先判断有没有全文, 再让浏览器导航到 PDF(导航能过 JS 挑战,页内 fetch 不能),用 CDP Fetch 域 拦下响应体写盘;导航不行再退回页内 fetch。等价于你点一下"下载"。

返回的 reason 会明确区分三件事: bot_challenge —— 被反爬挡住(先在浏览器窗口里手动打开一次这篇,再重试) no_entitlement —— 学校没订这刊(别再试了,走文献传递) not_found —— 链接/DOI 本身不对

probe_only=True 只做权限预检(3 秒出结论,不下载),适合先批量判断再决定下哪些。 需要登录态的先跑 browser_login。url 可以是文章页、doi.org 链接、elink 代理链接、 PDF 直链,或者裸 DOI(如 10.1007/s00039-016-0371-x)。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "browser_download"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes
filenameNo
probe_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.3

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full behavioral burden and does well: it explains that it reuses the browser_login Chrome instance, navigates rather than doing an in-page fetch (to clear JS challenges), intercepts the response body via the CDP Fetch domain, and falls back to fetch if navigation fails. It also documents the three failure reasons and what each implies. Minor gaps: no mention of timeouts, concurrency/rate limits, or where the file is written.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well front-loaded: purpose first, then mechanism, then return reasons, then the probe shortcut and prerequisites. The bulleted reason-code block earns its space, but the mechanism paragraph (CDP Fetch domain, navigation vs in-page fetch) is somewhat verbose for an agent that mainly needs to know the conditions, and the total is on the long side.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no output schema and no annotations, the description covers most of what an agent needs: accepted URL forms, probe mode, login prerequisite, and the meaning of each returned reason code, which substitutes for the missing output schema. It falls short on the filename parameter and on what path/identifier the saved file is returned under.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does for two of three parameters: url accepts article pages, doi.org links, elink proxy links, direct PDF links, or a bare DOI (with a worked example), and probe_only is explained as a 3-second permission pre-check that downloads nothing. The filename parameter is never mentioned, leaving its role and default behavior undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line names a specific verb (下载 / download) plus the resource (PDF) and immediately scopes the tool to PDFs that plain HTTP fetches cannot retrieve due to anti-bot protection on sites like Wiley, T&F, and ScienceDirect. That constraint distinguishes it from the plain-HTTP download sibling without requiring the agent to open either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use guidance (anti-bot sites), a prerequisite (run browser_login first when a login state is required), a batch pre-check path (probe_only=True returns a verdict in ~3s without downloading), and per-outcome routing — retry manually on bot_challenge, stop and use document delivery on no_entitlement, fix the link on not_found. Alternatives and exclusions are effectively covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.