Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

add_script_component_script

Idempotent

Adds a registered script to an entity that already has a script component and returns the updated entity summary. If no script component exists, use attach_script instead.

Instructions

Add a named script to an entity that ALREADY has a script component. Returns the updated entity summary. When NOT to use: if the entity has no script component yet, prefer attach_script, which creates the component and attaches the script in one call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesEntity ID
scriptNameYesRegistered script name (the parsed script's name attribute)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.7.0
    • changedInput schema / properties / id / description
      Previous value: -"An entity ID."New value: +"Entity ID"
    • addedInput schema / properties / scriptName / description
      Added value: +"Registered script name (the parsed script's name attribute)"
  2. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already indicate idempotentHint=true and destructiveHint=false, so no contradiction. The description adds meaningful behavioral context beyond annotations: it states the requirement that a script component must already exist, and it discloses the return behavior ('Returns the updated entity summary'), which is otherwise absent since there is no output schema.

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 compact and front-loaded: it states the core purpose first, then the return value, then the critical usage exclusion. Every sentence contributes information without redundancy or filler.

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?

This is a simple two-parameter mutation with clear annotations. The description covers the action, the precondition, the return value, and the alternative pathway. Nothing essential for correct invocation is missing for its complexity level.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters. The description's phrase 'named script' aligns with the scriptName parameter, but it does not add deeper parameter-level meaning beyond what the schema provides. Baseline 3 is appropriate because the schema carries the weight.

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 uses a specific verb and resource: 'Add a named script to an entity that ALREADY has a script component.' It clearly states the precondition and differentiates itself from the sibling tool attach_script by framing the distinction explicitly.

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 guidance on when not to use this tool: 'if the entity has no script component yet, prefer attach_script.' This directly names the alternative and the condition that selects it, leaving no ambiguity about routing.

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/playcanvas/editor-mcp-server'

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