Skip to main content
Glama

script-execute

Compile and run C# code dynamically in Unity Editor using Roslyn. Execute temporary scripts with defined classes and static methods for immediate results.

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}]
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: the code is compiled and executed dynamically, it's temporary ('one shot'), and won't be stored. However, it lacks details on permissions, rate limits, error handling, or output format. For a tool that executes arbitrary code, this is a moderate gap in safety and operational context.

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 a single, well-structured sentence that efficiently conveys the core functionality and key requirement. It's front-loaded with the main purpose and avoids unnecessary details, making every word count without waste.

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?

Given the complexity of executing arbitrary C# code, no annotations, and no output schema, the description is moderately complete. It covers the basic operation and constraints but lacks critical context like security implications, performance limits, or what the tool returns. This is adequate for a minimal viable description but leaves significant gaps for safe and effective use.

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 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema, only reiterating that code must define a class with a static method. It doesn't provide additional syntax, examples, or constraints not covered in the schema descriptions, meeting the baseline for high coverage.

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?

The description clearly states the tool's purpose: 'Compiles and executes C# code dynamically using Roslyn.' It specifies the verb ('compiles and executes'), resource ('C# code'), and technology ('Roslyn'). However, it doesn't explicitly differentiate from sibling tools like 'reflection-method-call' or 'script-update-or-create', which might also involve code execution or manipulation.

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 provides implied usage guidelines by stating requirements: 'The provided code must define a class with a static method to execute.' This suggests when to use it (for dynamic C# execution with Roslyn) but doesn't explicitly mention when not to use it or name alternatives among siblings, such as using 'reflection-method-call' for existing methods or 'script-update-or-create' for persistent scripts.

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