Skip to main content
Glama

close_lesson_loop

Close a lesson's teaching loop: mark it as completed after all submissions are graded and cognitive updates are recorded, with optional changelog receipt.

Instructions

把一节课的教学闭环收口: 写回执 (§5, 逐条列出本轮动了哪里) + 把这节课的 lesson_progress 置为 closed (§6 "已回课"终态, 由批改完成+回执送达触发, 不可逆——已 closed 的课再调用本工具会报错)。一次判决原则: 关课不产生新判决——判决齐不齐由 closure_progress 核对。receipt 现在是可选的 (2026-07-26): 它曾是"给学习者的 changelog", 但学习者侧的回执渲染卡已于 2026-07-22 退役 (行项退役案 — 行项是记账动词, 对学习者零价值; 已回课由课页的 已回课 徽标传达), 这份 changelog 现在没有读者, 不再强制老师写。想留档就照旧传, 每条 description 指认"动了哪里", 不重新评讲、不复述判决内容; 传了就仍然按老规矩验 (ref_id 悬空照拒)。注意: 本课若有已完成的 Live 课, 闸门 ④ 仍然要求一条引用其 snapshot/场评 的回执 —— 那种课上不传 receipt 是关不掉的。receipt 的每条 kind 必须落在封闭枚举内 (七种, 没有第八种): exercise_feedback(指认某份提交已批改, ref_id 指 submission——评语和分数的判决本体在 grade_exercise 记录上, 此处不复述评语、不重新打分) / forward_revision(前方课修订) / teacher_note(学习中的课的老师注) / erratum(已学完的课的勘误补丁) / flashcard_change(闪卡增删) / hypothesis_update(假设修订) / journal_entry(journal条目)。枚举外的 kind 一律打回——这是"不许发明新黑箱"的机器化, 不要绕过。 空转防护: 关课服务端强制四检——① 本课有已提交未批改的作业则拒关(先 grade_exercise 还债); ② 关课须带认知更新(post_lesson_evaluation 或指向真实假设的 hypothesis_update 回执), 皆无则须传 no_cognitive_update_reason; ③ 每条 ref_id 必须指向真实记录(悬空 ref 拒关); ④ 本课有已完成 Live 课则 回执须有一条 kind=journal_entry 引用其 snapshot。回执自带闭环进度——不用另查状态机。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
receiptNo可选 (2026-07-26 起; 渲染面已退役, 见工具说明), 每条 {kind, description, ref_id?}。省略或传空数组都算"本次不留 changelog"; 传了的每条仍走全套校验。
lesson_idYes必须是已存在的 lesson id(server 会查存在性)
idempotency_keyNo可选。幂等键 (建议 uuid) —— 同一 key 重放此调用返回首次结果, 不重复写入. 网络重试/断线重连时带上同一个 key, 而不是猜"上次到底写没写".
no_cognitive_update_reasonNo可选逃生舱 (空转防护 check ②): 本课确无认知更新时, 显式声明原因。仅在既无 post_lesson_evaluation 也无 hypothesis_update 回执时需要; 提供后写入关课记录 (lesson_progress)。
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses irreversibility, four validation checks (ungraded submissions, cognitive update requirement, ref_id validity, Live session receipt requirement), enum enforcement with rejection of unknown kinds, and the optional receipt with historical context. This is exceptionally transparent.

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

Conciseness3/5

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

The description is a dense wall of text without clear section breaks, containing historical details (dates, retirement rationale) that are not essential for invoking the tool correctly. While every sentence carries information, the length is excessive and could be better structured with bullets or headings. It is not front-loaded with the most critical operational rules.

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

Completeness5/5

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

For a complex tool with nested receipt objects and multiple validation rules, the description is highly complete. It covers all preconditions, error scenarios, validation logic, and even the rationale behind the enum. It notes that receipt carries closure progress, so no separate state-machine query is needed, addressing output expectations despite no output schema.

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?

Input schema has 100% parameter description coverage, so baseline is 3. The description enriches semantics by explaining when receipt is optional, the meaning of each receipt kind, the rules for ref_id, and when no_cognitive_update_reason is needed. It adds value beyond the schema, though much detail is also embedded in the schema.

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 description clearly states the tool's purpose: closing the lesson loop by writing a receipt and setting lesson_progress to closed. It distinguishes itself from siblings like get_lesson_closure_state (read-only status) and grade_exercise (grading) by specifying it is the terminal, irreversible action.

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?

Provides explicit guidance on when to use: after grading and receipt delivery, with a warning that it errors if already closed. It lists preconditions (four server-side checks) and alternatives (grade_exercise for grading, record_post_lesson_evaluation for cognitive updates), and explains when receipt is mandatory (when Live lesson exists) and the escape hatch (no_cognitive_update_reason).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sf-shenfeng/learn-shell'

If you have feedback or need assistance with the MCP directory API, please join our Discord server