Skip to main content
Glama

cocos_add_video_player

Add a video player component to Cocos Creator nodes for playing MP4 files from local clips or remote URLs, enabling cinematic intros, tutorials, and video ads in games.

Instructions

Attach cc.VideoPlayer — plays mp4 from a local cc.VideoClip or remote URL.

resource_type: 0=REMOTE (use remote_url), 1=LOCAL (use clip_uuid).

Use cases:

  • Cinematic intro / cutscenes (LOCAL with clip_uuid)

  • Rewarded video ads (REMOTE with ad-server URL)

  • In-game tutorials (LOCAL, loop=True)

On WeChat mini-game the player is a native overlay; stay_on_bottom and full_screen_on_awake change platform-specific layering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
resource_typeNo
remote_urlNo
clip_uuidNo
play_on_awakeNo
volumeNo
muteNo
loopNo
keep_aspect_ratioNo
full_screen_on_awakeNo
stay_on_bottomNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: the tool attaches a VideoPlayer component (implying a mutation/write operation), explains the resource_type parameter's meaning (0=REMOTE, 1=LOCAL), and discloses platform-specific behavior for WeChat mini-game regarding native overlays and layering controls. It doesn't mention error conditions, performance implications, or response format, but provides substantial behavioral context.

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 perfectly structured and concise. The first sentence states the core purpose. The second explains the critical resource_type parameter. The use cases section provides practical guidance in bullet points. The final sentence covers platform-specific behavior. Every sentence earns its place with valuable information, and the information is front-loaded appropriately.

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

Completeness4/5

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

Given a complex tool with 12 parameters, 0% schema coverage, no annotations, but with an output schema, the description does an excellent job. It explains the tool's purpose, provides usage guidance, clarifies parameter semantics, and discloses platform-specific behavior. The output schema existence means the description doesn't need to explain return values. The only minor gap is lack of explicit mention about error conditions or prerequisites, but overall it's highly complete for the context.

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?

With 0% schema description coverage for 12 parameters, the description must compensate significantly. It successfully adds crucial semantic meaning: it explains the resource_type parameter's enum values (0=REMOTE, 1=LOCAL) and their corresponding parameter usage (remote_url vs clip_uuid). It also provides context for loop parameter usage in tutorials and explains the platform-specific meaning of stay_on_bottom and full_screen_on_awake for WeChat mini-game. This adds substantial value beyond the bare schema.

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's purpose: 'Attach cc.VideoPlayer — plays mp4 from a local cc.VideoClip or remote URL.' It specifies the exact component being attached (cc.VideoPlayer), the media format (mp4), and the two source types (local clip or remote URL). This distinguishes it from sibling tools like cocos_add_audio_file or cocos_add_animation that handle different media types or components.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance with three distinct use cases: 'Cinematic intro / cutscenes (LOCAL with clip_uuid)', 'Rewarded video ads (REMOTE with ad-server URL)', and 'In-game tutorials (LOCAL, loop=True)'. It also includes platform-specific guidance for WeChat mini-game regarding layering behavior. This gives clear context for when and how to use this tool.

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