Skip to main content
Glama

write_script

Destructive

Creates a C# file under Unity's Assets folder from full file contents, with an option to overwrite an existing script. Use it to add or replace C# scripts in a Unity project.

Instructions

Create a C# file under Assets/. Send the whole file. Set overwrite=true to replace one.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "contents": "<contents>"
    },
    "name": "write_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
contentsYes
overwriteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already flag destructive=true and readOnly=false. The description adds the meaningful detail that destruction is scoped to one file and gated by an explicit overwrite flag, which tells the agent it can write new files safely without clobbering existing ones. What it omits is the failure mode when overwrite=false and the file exists, and whether parent directories are created.

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 short sentences with no filler; the action and the mandatory full-file requirement come first, and the conditional overwrite note comes last where a conditional belongs.

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?

For a three-parameter file-creation tool with no output schema, this covers the decision-relevant behavior. A sentence on the collision/error behavior would close the remaining gap.

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?

With schema coverage at 0%, the description carries the load and largely does: 'Send the whole file' defines the semantics of contents (full replacement, not a diff), and 'overwrite=true to replace one' defines the flag's behavior. The path format -- relative to the project root or Assets/, extension required -- is left unstated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource -- 'Create a C# file under Assets/' -- plus the key constraint that the file is written whole rather than incrementally. It never names a sibling, but the create-vs-read split from read_script is obvious from the verb alone.

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

Usage Guidelines3/5

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

'Set overwrite=true to replace one' implies the when-condition (only when a file already exists and should be replaced) without stating what happens otherwise or naming an alternative. Usage is inferable but not spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.