Skip to main content
Glama
xjtlu-library-mcp

xjtlu-library-mcp

by seally-web

save_exam_session

Save the ETD exam library login session (token and cookie) locally so searches and PDF downloads can authenticate; validates credentials before persisting.

Instructions

保存试卷库 etd.xjtlu.edu.cn 的登录态(搜索和下载都要它,缺一不可)。

要两样东西,都来自同一次浏览器登录:

  1. token —— 控制台执行 localStorage.getItem('token')

  2. cookie —— 形如 XJTLU_UserInfo=nGUb...(Network 里任一 api 请求的 Cookie 头, 只取 XJTLU_UserInfo 这一段即可) 可选 user_id = localStorage.getItem('uId'),部分接口会用到。

只保存在本机的 ~/.xjtlu-library-mcp/state/etd.json(权限 600),会上传吗?不会。 保存时会立刻验证一次,无效则不落盘。

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": {
      "cookie_string": "<cookie_string>",
      "token": "<token>"
    },
    "name": "save_exam_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYes
user_idNo
cookie_stringYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.3

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose a lot: local-only storage at ~/.xjtlu-library-mcp/state/etd.json, mode 600, no upload, and immediate validation that prevents invalid state from being written. What it omits is equally behavioral: whether a successful save overwrites an existing session, whether the old session is destroyed, and what a failed validation returns to the caller.

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?

The prerequisite constraint is front-loaded, then the two required inputs are itemized with a numbered list, which is easy to scan. Some phrasing is conversational filler ('会上传吗?不会') that could be tightened, but the total length is justified by the credential-extraction detail.

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 three-parameter write tool with no annotations and no output schema, the definition covers storage location, permissions, upload behavior, and validation, which is the information an agent needs to decide to call it. The remaining gap is overwrite/replace semantics on an existing session file and what a validation failure looks like to the caller.

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

Parameters5/5

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

Schema coverage is 0%, and the description compensates fully by telling the agent exactly how to obtain each value: token from localStorage.getItem('token'), cookie_string as the XJTLU_UserInfo segment of a Cookie header from a single browser login, and user_id as the optional localStorage uId used by some endpoints. All three parameters gain concrete extraction semantics absent from the bare schema.

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

Purpose4/5

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

The description opens with a specific verb and resource: save the login state for the exam-paper library at etd.xjtlu.edu.cn. The domain scoping ('试卷库 etd.xjtlu.edu.cn') does most of the work of separating it from save_library_cookie, but that sibling is never named, so the differentiation is inferred from scope rather than stated.

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

Usage Guidelines4/5

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

It states the operational context clearly — '搜索和下载都要它,缺一不可' tells the agent this is a prerequisite for exam search and exam download. It doesn't explicitly say to call this before those tools or what to do if a session already exists, but the when-to-use signal is unambiguous.

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