Skip to main content
Glama

捕获当前游戏 Canvas 图像

cocos_runtime_capture
Read-only

Captures the current game Canvas image for runtime inspection and debugging in Cocos Creator projects. Specify the project and capture options to retrieve the rendered frame.

Instructions

捕获当前游戏 Canvas 图像

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": {
      "projectId": "<projectId>",
      "params": "<params>"
    },
    "name": "cocos_runtime_capture"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsYes
projectIdYes
instanceIdNo
operationIdNo
expectedRevisionNo
runtimeInstanceIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.1
    • addedInput schema / properties / params / properties / expectedGeneration
      Added value: +{
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / params / properties / expectedSceneId
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / params / properties / frameMode
      Added value: +{
      +  "enum": [
      +    "nextFrame",
      +    "lastFrame"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / params / properties / imageDelivery
      Added value: +{
      +  "enum": [
      +    "image",
      +    "legacy-json"
      +  ],
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

D1.8/5.0
Behavior2/5

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

The annotations already state readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered without help from the description. The description adds nothing about frame timing (the nextFrame/lastFrame choice), the image-versus-legacy-json delivery mode, or what path/destroy do — behaviorally interesting facets that remain opaque.

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

Conciseness2/5

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

It is a single short sentence with no padding, but that brevity is under-specification rather than economy — the one sentence merely echoes the title and carries no information an agent could act on.

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

Completeness1/5

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

For a tool with a nested parameter object, enum choices, frame-mode semantics and no output schema, the description is far too thin; an agent cannot know what is returned (image bytes? base64? JSON) or how to shape params correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the nested params object exposes roughly sixteen undocumented sub-properties (frameMode, imageDelivery, path, destroy, expectedSceneId, expectedGeneration, subscriptionId, etc.). The description explains none of them, leaving even the two required parameters (projectId, params) unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tautological: description restates name/title.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites (e.g. must a runtime be connected or a projectId resolved first?), and no mention of alternatives like cocos_scene_snapshot for scene state versus this for live Canvas pixels. The agent must infer all routing from the name alone.

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