Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PTA_EMAILYesYour PTA (pintia.cn) account email, used for first-time login when no valid session exists.
PTA_PASSWORDYesYour PTA (pintia.cn) account password, used for first-time login when no valid session exists.
PTA_WORK_DIRNoThe only directory the tools are allowed to read/write (programs, answers.json). Defaults to <PTA_STATE_DIR>/work.
PTA_STATE_DIRNoRoot directory for runtime state (cookies.json, work/). Defaults to ~/.local/state/pta-auto-mcp.
PTA_COOKIE_FILENoPath to the cookies file used to persist/reuse the session. Defaults to <PTA_STATE_DIR>/cookies.json.
PTA_COMPACT_JSONNoSet to 0 to have tools return structured dicts instead of the default compact JSON strings.1
PTA_MIN_LOGIN_INTERVALNoMinimum interval in seconds between login attempts (rate limiting). Defaults to 20s.20

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
pta_loginA

登录并持久化会话;已有有效会话时直接复用。滑块验证码由纯协议求解器自动通过。

Args: email: 邮箱(与 phone 二选一,也可用环境变量 PTA_EMAIL)。 password: 密码(也可用环境变量 PTA_PASSWORD)。 phone: 手机号,不含 +86。 remember: 是否"记住我"。 max_captcha: 验证码重试轮数,默认 2;站点风控严格时调大无益。 pace: 轮次间退避秒数。

pta_list_examsA

列出练习/考试,给出提交时要用的 exam_id。

Args: only_active: True 只要未结束的(默认);False 返回全部可见题目集。 limit: 条数上限。

pull_exam_setA

按题型取题,并用 summaries 核对各题型题量(不一致会报错,不会返回残缺数据)。

Args: problem_set_id: 题目集 ID(来自 pta_list_exams)。 problem_types: 只要这些题型,缺省全部。 mode: index 只回 id/题型/标题(概览);digest 只回题面(首行即标题);content 题面更长。 offset / limit: 分页,limit=0 表示全部(digest 建议 15~30)。 max_content_chars: 题面截断长度。

submit_answersA

提交答案:客观题按题型整卷提交,编程题逐题提交并回传判题结果。

答案形如(每个题型一段,可给列表): {"problemType": "TRUE_OR_FALSE", "details": [{"problemSetProblemId": "...", "answer": "TRUE"}]} {"problemType": "MULTIPLE_CHOICE", "details": [{"problemSetProblemId": "...", "answer": "B"}]} {"problemType": "PROGRAMMING", "details": [{"problemSetProblemId": "...", "program_path": "programs/p1.py"}]}

Args: exam_id: 考试 ID(来自 pta_list_exams)。 answers: 上述结构(或它们的列表);大体积答案用 answers_file 指向 work/ 下的 JSON,避免在对话里重复贴。 answers_file: work/ 下 JSON 文件路径,内容同 answers(整卷归档时给列表,每个题型一段)。 dry_run: True(默认)只回提交计划,确认后传 False。

pta_submission_detailA

查看某次提交的判题结果:总状态/得分、每个用例结果、失败用例的输出摘要。

Args: exam_id: 考试 ID。 submission_id: submit_answers 返回的 submission_id。 max_text: 失败用例输出截断长度。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool maps to a distinct step in the exam workflow: login, list exams, pull problem set, submit answers, view submission detail. The descriptions make the boundary between pta_list_exams (exam_id discovery) and pull_exam_set (problem content retrieval) explicit, so no overlap remains.

Naming Consistency3/5

All names are snake_case, but prefixing is inconsistent: pta_login, pta_list_exams, and pta_submission_detail carry the pta_ prefix while pull_exam_set and submit_answers do not. The verb_noun style is mostly respected but pta_submission_detail drops the verb entirely.

Tool Count5/5

Five tools is a tight, well-scoped set that mirrors the end-to-end task of logging in, finding an exam, pulling problems, submitting, and reviewing results. Each tool clearly earns its place with no redundancy.

Completeness4/5

The core lifecycle (auth, discovery, retrieval, submission, result inspection) is fully covered, so agents can complete the primary workflow. Minor gaps like logout or listing all past submissions exist but agents can work around them using returned submission_ids.

Maintenance

ActivityMaintained
ResponsivenessNo issues