Skip to main content
Glama

save_lecture_frag

Save lecture fragments to the backend with upsert by subject, book, and owner. Replace image placeholders with OSS URLs and reject unmatched fragments unless allow_toc_fail is set.

Instructions

片段 IR → :9090 upsert 入库(唯一入库口,UK=subjectId+bookId+owner 幂等覆盖)。需先 login。

图回填:image_map={rid:ossUrl} 把 content 里 〖图:rId〗占位换成 OSS 地址;无 ossUrl 的 image 节点会被剔除 并在 unresolved_images 里报告(不静默丢)。对齐闸:任何 UNMATCHED 片段默认拒绝入库(除非 allow_toc_fail)。 参数: ir_path : convert_lecture_docx 产出的 IR 文件路径(与 frags 二选一,优先) frags : 片段 IR 列表 [{subjectId,title,contentJson,status?}](与 ir_path 二选一) book_id : 教辅套 id(ir_path 里带则以其为准) image_map : {rId: ossUrl}(upload_image 的产物) owner : 归属 uid;省略=登录者(admin 登录省略即官方库覆盖) allow_toc_fail : True 才允许含未匹配 KG 的片段入库(BE 仍会因 subjectId 不存在而单条失败) 返回: BE saveFrags 响应 {ok, owner, results:[{subjectId,action}], stats} + {unresolved_images, view_url?}。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fragsNo
ownerNo
book_idNoCC7S
ir_pathNo
image_mapNo
allow_toc_failNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully discloses behavior: upsert semantics, image_map processing (replacement and removal with reporting), alignment guard, authentication requirement, and owner defaulting. The return format is also detailed.

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

Conciseness5/5

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

The description is concise yet comprehensive, front-loading the core purpose and then systematically covering details in a structured paragraph with bullet points. No unnecessary information.

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?

Given the tool's complexity (6 parameters, nested objects, side effects), the description covers prerequisites, inputs, behavior, and return values. The output format is described in detail, compensating for the absent output schema.

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?

Despite 0% schema description coverage, the description explains all 6 parameters in depth, including their purpose, mutual exclusivity, default values, and nested structure for frags items. This compensates fully.

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 that the tool is the sole entry point for upserting lecture fragments into the database, with a unique key for idempotency. It distinguishes itself from sibling tools like convert_lecture_docx (which produces the input) and remove_lecture_frag (which deletes).

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?

The description provides usage context: login prerequisite, mutual exclusivity of ir_path and frags, precedence of book_id from ir_path, and the allow_toc_fail flag. It does not explicitly compare to other tools for when-not-to-use, but the context is clear.

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/RuntimeAll/teacher-mcp'

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