Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

set_script_text

Update script content in PlayCanvas Editor by specifying the asset ID and new text, enabling real-time 3D application development.

Instructions

Set script text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetIdYes
textYes

Implementation Reference

  • The handler function for the 'set_script_text' MCP tool. It receives assetId and text, and forwards the call to the WSS method 'assets:script:text:set'.
    ({ assetId, text }) => {
        return wss.call('assets:script:text:set', assetId, text);
    }
  • Input schema for the 'set_script_text' tool using Zod: assetId (number) and text (string).
    {
        assetId: z.number(),
        text: z.string()
    },
  • Registration of the 'set_script_text' tool using mcp.tool(), including name, description, schema, and handler. Note: startLine adjusted to capture full block.
    export const register = (mcp: McpServer, wss: WSS) => {
        mcp.tool(
            'set_script_text',
            'Set script text',
            {
                assetId: z.number(),
                text: z.string()
            },
            ({ assetId, text }) => {
                return wss.call('assets:script:text:set', assetId, text);
            }
        );
  • src/server.ts:81-81 (registration)
    Invocation of the register function for assets/script tools in the main MCP server setup.
    registerAssetScript(mcp, wss);
Behavior1/5

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

With no annotations provided, the description carries full burden but offers no behavioral information. It doesn't disclose whether this is a read or write operation, what permissions are required, whether changes are destructive, what happens to existing script text, or any rate limits or side effects.

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?

While technically concise with only three words, this is under-specification rather than effective conciseness. The description fails to provide necessary information that would help an agent understand and use the tool correctly.

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?

The description is completely inadequate for a mutation tool with 2 parameters and no annotations or output schema. It provides no context about what the tool does, how to use it, what parameters mean, or what to expect as a result, leaving critical gaps for agent understanding.

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% with 2 required parameters (assetId and text), and the description provides no information about either parameter. It doesn't explain what assetId refers to, what format text should be in, or any constraints or examples for these inputs.

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?

The description 'Set script text' is a tautology that restates the tool name without adding meaningful context. It specifies the verb 'set' and resource 'script text', but doesn't explain what this means operationally or distinguish it from sibling tools like 'add_script_component_script' or 'script_parse'.

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

Usage Guidelines1/5

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

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or exclusions, leaving the agent with no usage direction despite multiple related sibling tools existing.

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

Related 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