Skip to main content
Glama

script-update-or-create

Update or create C# script files in Unity projects, automatically refreshing assets and reporting compilation errors to maintain code integrity.

Instructions

Updates or creates script file with the provided C# code. Does AssetDatabase.Refresh() at the end. Provides compilation error details if the code has syntax errors. Use 'script-read' tool to read existing script files first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the script file. Example: "Assets/Scripts/MyScript.cs"
contentYesFull C# source code content for the file.
requestIdNo
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 behaviors: it performs AssetDatabase.Refresh() automatically, provides compilation error details for syntax errors, and has an upsert functionality (update or create). This covers important operational traits beyond basic input-output.

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 front-loaded with the core purpose, followed by essential behavioral details and usage guidance in three concise sentences. Each sentence adds clear value without redundancy, making it efficient and well-structured.

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 mutation tool with no annotations and no output schema, the description does a good job covering key behaviors (refresh, error handling) and usage context. However, it lacks details on permissions, side effects on existing files, or response format, which are important for a write operation, leaving minor gaps in completeness.

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 67% (2 out of 3 parameters have descriptions). The description adds no additional parameter semantics beyond what the schema provides (e.g., it doesn't clarify 'requestId' or elaborate on 'filePath'/'content' constraints). With moderate schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate for gaps.

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 specific action ('Updates or creates script file'), the resource ('script file'), and the content type ('C# code'). It distinguishes from sibling tools by mentioning 'script-read' for reading existing files, establishing its unique role in the toolset.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (updating/creating C# scripts) and explicitly references 'script-read' as a prerequisite for reading existing files. However, it does not specify when not to use it or alternatives for non-C# files or other asset types, which slightly limits its 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/butterlatte-zhang/unity-ai-bridge'

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