reflection-method-call

A Unity tool for calling C# methods by searching for their type and method names, including private methods. Reflection is a programming technique that lets software find and invoke methods at runtime.

In plain words
What is it for?
Use it to invoke a known C# method after first obtaining its method details with `reflection-method-find`. You can pass method parameters and, when needed, an object instance.
Why use it?
It allows an agent to call existing C# code without writing a separate wrapper for every method. It also supports static methods, object methods, and Unity calls that must run on the main thread.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ivanmurzak/unity-mcp/reflection-method-call
Any agent
npx skills add IvanMurzak/Unity-MCP --skill reflection-method-call
Clone the repo
git clone --depth 1 https://github.com/IvanMurzak/Unity-MCP

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,491 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.02491
Opus 5 $0.00024 $0.01246
Sonnet 5 $0.00010 $0.00498
Haiku 4.5 $0.00005 $0.00249

Measured 2d ago against content hash ac15503bb0a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reflection-method-call scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Unity-MCP-Plugin/.claude/skills/reflection-method-call/SKILL.md · 253 lines

How it starts

The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Method C# / Call

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.

Match levels (apply to typeName, MethodName, Parameters)

  • typeNameMatchLevel / methodNameMatchLevel (default 1 — contains ignoring case): 0 ignore filter, 1 contains-ic, 2 contains-cs, 3 starts-with-ic, 4 starts-with-cs, 5 equals-ic, 6 equals-cs.
  • parametersMatchLevel (default 2 — equals): 0 ignore filter, 1 count matches, 2 equals.

Inputs

  • targetObject (optional) — for instance methods. When null, a new instance is created from the declaring type. Required shape: { type, value } (value is deserialized to type).
  • inputParameters (optional) — list of { type, name, value }. Names are enhanced against the resolved method signature if omitted.
  • executeInMainThread (default true) — Unity API calls should keep this true; set false only for thread-safe pure logic.

How to Call

unity-mcp-cli run-tool reflection-method-call --input '{
  "filter": "string_value",
  "knownNamespace": false,
  "typeNameMatchLevel": 0,
  "methodNameMatchLevel": 0,
  "parametersMatchLevel": 0,
  "targetObject": "string_value",
  "inputParameters": "string_value",
  "executeInMainThread": false
}'

For complex input (multi-line strings, code), save the JSON to a file and use:

unity-mcp-cli run-tool reflection-method-call --input-file args.json

Or pipe via stdin (recommended):

unity-mcp-cli run-tool reflection-method-call --input-file - <<'EOF'
{"param": "value"}
EOF

Troubleshooting

If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead. Read the /unity-initial-setup skill for detailed installation instructions.

Input

Name Type Required Description
filter any Yes Method reference. Used to find method in codebase of the project.
knownNamespace boolean No Set to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false.
typeNameMatchLevel integer No Minimal 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.
methodNameMatchLevel integer No Minimal 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.
parametersMatchLevel integer No Minimal match level for 'Parameters'. 0 - ignore 'filter.Parameters', 1 - parameters count is the same, 2 - equals (default value).
targetObject any No Specify 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).
inputParameters any No Method 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).
executeInMainThread boolean No Set to true if the method should be executed in the main thread. Otherwise, set to false.

Read the full file on GitHub · 253 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 253 lines · 48 tokens per session scan A ac15503bb0a0

Subscribe to this mod's changes

reflection-method-call is a skill published in the GitHub repository IvanMurzak/Unity-MCP (4,047 stars, last pushed 8d ago), licensed Apache-2.0. It adds 48 tokens to every session and 2,491 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

unity-mcp-orchestrator

Orchestrate Unity Editor via MCP (Model Context Protocol) tools and resources. Use when working with Unity projects through MCP for Unity - creating/modifying GameObjects, editing scripts, managing scenes, running tests, or any Unity Editor automation. Provides best practices, tool schemas, and workflow patterns for…

CoplayDev/unity-mcp · 72 tokens

blender-to-unity

Hand off a model from Blender (via BlenderMCP) into Unity (via MCP for Unity) — export the current Blender model, import it through importmodelfile, and place it in the open scene. Use when the user has BlenderMCP and MCP for Unity both connected and wants to bring a Blender model into Unity. Does NOT drive Blender's…

CoplayDev/unity-mcp · 91 tokens

mcp-source

Switch MCP for Unity package source in connected Unity projects. Use /mcp-source [main|beta|branch|local] to swap between upstream releases, your remote branch, or local dev checkout.

CoplayDev/unity-mcp · 44 tokens

professional-game-developer

Universal production game engineering skill — design, build, profile, test, and ship games across Unreal Engine 5, Unity 6 (DOTS), Godot 4.3+, Roblox (Luau), and Web/Custom engines with senior studio-grade architectural discipline. Encompasses all 42 specialized game studio job roles across 6 departments: Game Design…

chahat1709/professional-game-developer.skill · 103 tokens

uw-ui-toolkit-binder

Generate Unity 6+ UI Toolkit Runtime Data Binding code using MVVM pattern with [CreateProperty], DataBinding, and PropertyPath. Use when creating UI screens, HUDs, menus, inventories, settings panels, or any data-bound UI elements with UI Toolkit. Triggers on requests like "create a health bar", "build the HUD", "make…

devdavv/unity-ai-workflow · 177 tokens

uw-dependency-injection

Opt-in DI architecture using Reflex for Unity 6+. Covers container setup, scoping, injection, command pattern, update management, and class taxonomy. Use when ProjectConfig.yaml -> architecturepattern is "di-first", or when the user asks about dependency injection, inversion of control, service architecture, or…

devdavv/unity-ai-workflow · 159 tokens