Skip to main content
Glama

script-execute

Compile and execute C# code dynamically in Unity Editor using Roslyn. Define a class with a static method to run custom logic on the fly without saving scripts.

Instructions

Compiles and executes C# code dynamically using Roslyn. The provided code must define a class with a static method to execute.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
csharpCodeYesC# code that compiles and executes immediately. It won't be stored as a script in the project. It is temporary one shot C# code execution using Roslyn. IMPORTANT: The code must define a class (e.g., 'public class Script') with a static method (e.g., 'public static object Main()'). Do NOT use top-level statements or code outside a class. Top-level statements are not supported and will cause compilation errors.
classNameNoThe name of the class containing the method to execute.Script
methodNameNoThe name of the method to execute. It must be a static method in the class provided above.Main
parametersNoSerialized parameters to pass to the method. If the method does not require parameters, leave this empty. Schema: [{"name":"string","typeName":"string","value":any}]
Behavior4/5

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

The description discloses key behavioral traits: the code is temporary, not stored, and must define a class with a static method (no top-level statements). This goes beyond what annotations (none provided) indicate. It does not mention error handling, output format, or side effects, but for a code execution tool, the stated constraints are sufficient.

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 extremely concise, consisting of two short sentences that front-load the core purpose and key constraint. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description adequately covers the tool's purpose and constraints, including the required class/method structure. However, it lacks information about return values or compilation error handling, which is notable given the absence of an output schema. The complexity of code execution warrants a bit more detail on output or errors.

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?

The input schema has 100% description coverage, providing detailed parameter documentation. The description reinforces these details (e.g., 'temporary one shot') but does not add significant new semantic information beyond what the schema already provides.

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 tool compiles and executes C# code dynamically using Roslyn, specifying the required structure (class with static method). It distinguishes itself from siblings like 'reflection-method-call' and 'runtime-invoke' by focusing on dynamic compilation rather than invoking existing methods.

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?

The description implies usage for one-shot temporary code execution (not stored scripts), which differentiates from siblings like 'script-read' or 'script-update-or-create'. However, it does not explicitly compare with other code execution tools like 'runtime-invoke', leaving some ambiguity for the agent.

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