Skip to main content
Glama

把采集结果渲染成人能看懂的单文件网页

view_render

Render captured debug data into an interactive dark-themed HTML report with zoom, pan, and replay. Feed raw data or a file path to auto-generate timelines, scope waveforms, or hotspot rankings—skip manual webpage coding.

Instructions

已有的采集结果渲染成一个可交互的单文件 HTML(深色主题、可缩放/平移/回放),给人看「问题出在哪、场景长什么样」——不必再手写网页。渲染层是固定的:同一类数据画出来长得一样,看图的人不用每次重新适应。 最常用的一步调用:把采集工具的返回原样丢进 data(不用先转格式,工具自己认): · trace_swd_read / trace_buff_dump / trace_eventrec → 事件时间线:上下文泳道、切换竖线(放大显示切向谁)、中断进出、异常标记、丢失断口; · trace_scope_read(或自己拼 {t:[…], 变量:[…]})→ 变量波形(bool/enum 自动阶梯); · trace_pcsample / trace_profile / coverage_read → 函数热点排行; · trace_eventrec 的 items(Event Statistics)→ 每个事件的耗时排行; · trace_record(action="read") → 函数进入/退出时间线; · 自己写 {kind:"timeline|scope|bars|report", …} → 展示算法/自定义信号。 数据大时先落盘:trace_swd_read(out_file="trace.json") 拿到几万条事件时,别再把它塞回对话,改传 data_file="trace.json"(省 token,也避免截断)。 params:view=auto|timeline|scope|bars|report(默认 auto 认数据不认人);names="0x10=switch,1=led_task" 给 id 起人名;top=热点头条数;out=输出路径(默认 ./mdkdebug_views/-<时间戳>.html);title/subtitle 写进页面抬头。 认不出就报错、不画空图(error_code=view-unknown-data/view-bad-)。返回 counts 是画了什么,badges 是页面顶部的关键数,next 是给人看的操作提示;返回 path 直接交给用户,浏览器(file://)打开即可,页面*无外部依赖、无需联网。 一次快照,不会自动刷新:数据变了要重新渲染。页面上「这说明不了什么」那栏是边界声明(图上没有的=没被记录/没插桩,不等于没发生),讲结论前先看它。 只想讲清一个问题(结论+证据+图)用 report:sections 里的 view 可以直接嵌采集结果。 【参数】必填: 无;可选: data, data_file, view, title, subtitle, names, top, max_events, out 【调用示例】{} 【风险】中——会改变目标状态或占用共享资源(调试态/串口/Keil 实例),必要时可回退。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outNo
topNo
dataNo
viewNoauto
namesNo
titleNo
subtitleNo
data_fileNo
max_eventsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4.6/5.0
Behavior5/5

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

The description thoroughly discloses behavioral traits beyond annotations. It states the tool is not read-only (annotations readOnlyHint=false), mentions the risk of changing target state or occupying shared resources, notes that it produces a one-time snapshot (no auto-refresh), and explains the boundary statement in the page. This adds significant context that annotations alone do not provide.

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 description is long but well-structured with bullet points and bold headings. It front-loads the core purpose and then details parameters and usage. Every sentence adds value, and the formatting makes it scannable. It's appropriately sized for the tool's complexity, though it could be slightly trimmed without losing essential guidance.

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?

The description covers the tool's return values (counts, badges, next, path), explains error behavior, gives usage examples, and provides risk and boundary notes. It is complete for an agent to invoke it correctly without needing to inspect the schema or other docs.

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?

With schema_description_coverage at 0%, the description compensates by explaining most parameters: data, data_file, view (with options), names, top, out, title/subtitle. It provides concrete formats and defaults (e.g., out default path). However, it does not explain 'max_events' or the exact structure of custom data objects, so it's not fully comprehensive.

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 renders existing collected results into an interactive single-file HTML with specific themes and interactions. It explicitly distinguishes it from other tools by saying it's for visualization, not data capture, and lists accepted data types and output formats. This is a specific verb+resource that differentiates it from siblings like view_guide.

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 provides explicit context on when to use the tool (after data collection) and how to call it with examples for various data types. It gives guidance on handling large data (using data_file to avoid token truncation) and when to use the 'report' view for focused explanations. However, it does not explicitly name alternative tools or say when NOT to use it, though the context is clear enough for an agent to select it appropriately.

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