Skip to main content
Glama

cocos_press_key_preview

Simulate keyboard input in Cocos Creator game previews to test interactive elements like menus, movement controls, and form submissions.

Instructions

Press a single key in the running preview.

key uses Playwright's names — 'Enter', 'Space', 'ArrowUp', 'Escape', 'a', 'F1', etc. Cocos's systemEvent KeyCode hook fires on keydown/keyup as expected. Use this for keyboard-driven input (pause menus, player movement, form submit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
keyYes
wait_msNo
viewport_widthNo
viewport_heightNo
timeout_msNo
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool simulates keydown/keyup events via Cocos's 'systemEvent' KeyCode hook, which is useful behavioral context. However, it lacks details on error handling, side effects (e.g., if the preview must be running), or performance implications, leaving gaps for a mutation tool.

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 front-loaded with the core purpose, followed by key details and usage examples in three concise sentences. Every sentence adds value without redundancy, making it efficient and well-structured.

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

Completeness3/5

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

Given 6 parameters with 0% schema coverage and no output schema or annotations, the description is incomplete. It covers the 'key' parameter well and hints at the tool's behavior but omits details on other parameters, error conditions, and return values, which are significant gaps for a tool with multiple inputs.

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 description coverage is 0%, so the description must compensate. It explains the 'key' parameter's semantics (uses Playwright's names and examples like 'Enter', 'a'), adding crucial meaning beyond the schema. However, it does not address other parameters like 'url', 'wait_ms', or viewport settings, leaving them undocumented.

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 specific action ('Press a single key') and target context ('in the running preview'), distinguishing it from sibling tools like 'cocos_type_preview' (typing text) or 'cocos_click_preview' (mouse clicks). It provides a verb+resource combination that is precise and unambiguous.

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 explicitly states when to use this tool ('Use this for keyboard-driven input (pause menus, player movement, form submit)'), providing clear context. However, it does not specify when not to use it or mention alternatives like 'cocos_type_preview' for text input, which prevents a perfect score.

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/chenShengBiao/cocos-mcp'

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