Skip to main content
Glama

session_render

Renders UI layouts offscreen to PNG via Gradle tasks, enabling emulator-free visual checks for truncated text, missing cards, light/dark theme, and spacing.

Instructions

在会话里离屏渲染界面并直接把 PNG 返回给你看 —— 不需要模拟器,复用热的 Gradle daemon。适合验收布局:文字有没有被截断、卡片有没有渲染、深浅色对不对、间距是否合理。需要项目里有渲染任务(这个项目已内置 :desktop:renderScreens、renderHomePreview、renderBusPreview、renderDegreePreview 等多个)。⚠️ 建会话时请设 cjkFonts: true,否则中文全渲染成方块 □。⚠️ 它只反映布局,不覆盖启动崩溃、真实数据加载和动画 —— 那些仍需模拟器。

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": {
      "session": "<session>",
      "issueNumber": "<issueNumber>"
    },
    "name": "session_render"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionYessession_start 返回的 session id
maxImagesNo最多返回几张图,默认 4。
outputDirNoPNG 输出目录,默认自动生成一个临时目录。
timeoutMsNo等待毫秒数,默认 20 分钟
gradleTaskNo要执行的渲染任务,默认 ":desktop:renderScreens"。
issueNumberYes会话对应的 issue 号

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses a hard prerequisite (the project must contain a render task, with named built-in examples), a critical session_start prerequisite (`cjkFonts: true` or Chinese renders as tofu boxes), and the scope limits (layout only, no launch crashes, real data, or animation). This is exactly the failure-mode and prerequisite context annotations would normally supply.

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?

Front-loaded with purpose and use case, then prerequisites and limits; the ⚠️ markers correctly flag the two highest-cost mistakes. It is dense but not padded — every clause is actionable — though the prerequisite/gotcha section could be tightened marginally.

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 six-parameter tool with no output schema and no annotations, the description covers purpose, prerequisites, implicit ordering via the `session` parameter description, return format (PNG images), and scope boundaries. Nothing an agent needs in order to invoke it correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3. The description adds real meaning beyond it by enumerating concrete built-in values for the `gradleTask` parameter (`:desktop:renderScreens`, `renderHomePreview`, `renderBusPreview`, `renderDegreePreview`) and by clarifying that multiple images are returned, which contextualizes `maxImages`.

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?

States a specific verb and resource ('离屏渲染界面并直接把 PNG 返回'), plus the mechanism that makes it unique ('不需要模拟器,复用热的 Gradle daemon'). The explicit contrast against emulator-based capture lets an agent distinguish it from session_screenshot/session_run without opening their schemas.

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?

Gives a clear use case ('适合验收布局:文字有没有被截断、卡片有没有渲染、深浅色对不对、间距是否合理') and an explicit when-not clause ('不覆盖启动崩溃、真实数据加载和动画 —— 那些仍需模拟器'). The alternative is described by category ('模拟器') rather than by sibling tool name, which is slightly weaker than naming the alternative.

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