Skip to main content
Glama

reflection-method-call

Call C# methods in Unity, including private ones, by providing method schemas and input parameters to execute functionality within the Unity Editor.

Instructions

Call C# method. Any method could be called, even private methods. It requires to receive proper method schema. Use 'reflection-method-find' to find available method before using it. Receives input parameters and returns result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterYesMethod filter. SCHEMA: {"namespace":"UnityEngine","typeName":"Application","methodName":"get_dataPath","inputParameters":[]}
knownNamespaceNoSet to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false.false
typeNameMatchLevelNoMinimal match level for 'typeName'. 0 - ignore 'filter.typeName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive.1
methodNameMatchLevelNoMinimal match level for 'MethodName'. 0 - ignore 'filter.MethodName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive.1
parametersMatchLevelNoMinimal match level for 'Parameters'. 0 - ignore 'filter.Parameters', 1 - parameters count is the same, 2 - equals (default value).2
targetObjectNoSpecify target object to call method on. Should be null if the method is static or if there is no specific target instance. New instance of the specified class will be created if the method is instance method and the targetObject is null. Required: type - full type name of the object to call method on, value - serialized object value (it will be deserialized to the specified type). Schema: null for static methods, or {"instanceID":int}
inputParametersNoMethod input parameters. Per each parameter specify: type - full type name of the object to call method on, name - parameter name, value - serialized object value (it will be deserialized to the specified type). Schema: [{"typeName":"string","value":any}]
executeInMainThreadNoSet to true if the method should be executed in the main thread. Otherwise, set to false.true
Behavior3/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 adds some context: it mentions that private methods can be called and that it returns a result. However, it lacks details on critical behaviors like error handling, performance implications, security permissions needed, or side effects (e.g., whether it modifies state). This makes it adequate but with clear gaps for a tool with such broad capabilities.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences that are front-loaded: the first states the core purpose, the second gives a key constraint, and the third outlines input/output. There's little waste, but it could be slightly more structured (e.g., bullet points for key points) to improve readability, hence a 4 instead of 5.

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 tool's high complexity (8 parameters, no annotations, no output schema), the description is incomplete. It covers the basic purpose and prerequisite but lacks details on return values (only mentions 'returns result' vaguely), error cases, or advanced usage scenarios. With no annotations or output schema, more context is needed to fully guide an agent, making it minimally viable but with gaps.

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 8 parameters thoroughly. The description adds minimal value beyond the schema, only implying that 'filter' should contain a method schema from 'reflection-method-find'. It doesn't explain parameter interactions or provide examples beyond what's in the schema descriptions. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Call C# method. Any method could be called, even private methods.' It specifies the verb ('Call') and resource ('C# method'), and distinguishes it from sibling 'reflection-method-find' by mentioning it requires a method schema from that tool. However, it doesn't explicitly differentiate from other non-reflection tools, keeping it at 4 instead of 5.

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: 'Use reflection-method-find to find available method before using it.' This gives explicit guidance on prerequisites. However, it lacks explicit exclusions or alternatives beyond the sibling tool, such as when not to use it or comparisons to other method-calling tools if they existed.

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