Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

set_script_text

Idempotent

Overwrite an existing script asset's full source code, then run script_parse so the editor re-reads the script's name and attributes.

Instructions

Overwrite the source code of an existing script asset. Provide the full file contents in text. After changing the code, call script_parse so the editor re-reads the script's name and attributes. When NOT to use: to attach a script to an entity (use attach_script) or to create the script asset itself (use create_assets type="script").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesFull JavaScript/TypeScript source of the script
assetIdYesScript asset id

Schema Changelog

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

  1. Changed2 schema fields changedv0.7.0
    • addedInput schema / properties / assetId / description
      Added value: +"Script asset id"
    • addedInput schema / properties / text / description
      Added value: +"Full JavaScript/TypeScript source of the script"
  2. First observedv1.0.0

TDQS

A4.1/5.0
Behavior1/5

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

The description says 'Overwrite the source code,' which is a destructive/overwriting operation, but the annotation destructiveHint is false. This is a direct annotation contradiction, so behavioral transparency must score 1 despite the description otherwise being transparent.

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?

Three sentences, no filler. The core action is front-loaded, the necessary post-step is included, and the when-not-to-use guidance is concise. Every sentence earns its place.

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 two-parameter tool with no output schema, the description covers the action, the required next step, and when to choose sibling tools. Nothing essential 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?

Both parameters are already documented at 100% schema coverage. The description adds the important nuance that text must contain the full file contents, reinforcing overwrite semantics rather than a partial edit.

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 opens with a specific verb and resource: 'Overwrite the source code of an existing script asset.' It also explicitly contrasts itself with attach_script and create_assets, so an agent can distinguish it from the most relevant siblings.

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 'When NOT to use' section names exact alternatives: attach_script for attaching a script to an entity, and create_assets type="script" for creating the asset. It also gives a concrete follow-up instruction to call script_parse after editing, which is strong usage guidance.

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