Find C# Methods via Reflection

VerifiedCaution

Finds C# methods across all loaded assemblies by name, type, or parameters — including private ones — and returns MethodData usable for later reflection calls.

Sby Skills Guide Bot
DevelopmentIntermediate
9/20/2026
Claude CodeCursorWindsurfCopilotCodex
#csharp#reflection#unity#method-discovery#code-navigation

Recommended for

Automated summary

Searches for C# methods across all assemblies loaded in a Unity project, including private ones, and returns serialized method metadata usable as an invocation schema.

Strengths

  • Finds private methods, not just the public API surface
  • Separate configurable match levels for type name, method name and parameters
  • JSON (MethodData) output can be passed straight back as a filter to reflection-method-call
  • Covers every loaded assembly without needing the exact namespace

Limitations

  • Depends on the external unity-mcp-cli tool being installed (npm or npx)
  • Requires a running Unity project with the MCP server connected
  • Name-based searches can return many hits on large projects, so match levels must be tuned
When to use it

When you need to locate a specific C# method in a Unity codebase, especially a private one, before invoking it via reflection.

When not to use it

For browsing or reading source code without intending to invoke a method, or when unity-mcp-cli is not available in the environment.

Security analysis

Caution
Quality score84/100

This is documentation for a legitimate Unity MCP tool that queries reflection metadata. It carries no destructive commands, no data exfiltration, no encoded payloads, and no attempts to disable safety. The only meaningful risk is ordinary command execution of a third-party CLI and reflection access to private members, which is the tool's stated purpose and requires local project access — hence caution rather than safe.

Findings
  • •Instructs executing a third-party CLI (`unity-mcp-cli` / `npx unity-mcp-cli`) via bash, including an optional global npm install
  • •Reflection-based lookup intentionally surfaces private methods across all loaded assemblies, which is powerful (though normal for Unity editor tooling)
  • •Pipes JSON via stdin/heredoc into the CLI; no obfuscation or arbitrary shell interpolation of user data
How this analysis is made

Examples

Find a private method by name
Use reflection-method-find to locate the private method RespawnPlayer in the loaded assemblies, then show me its MethodData.
Narrow by type and exact name
Find the method named Update with typeNameMatchLevel 5 in the PlayerController type and list every match.
Match by parameter count
Search for all methods named ApplyDamage with parametersMatchLevel 1 and one parameter, then report which types declare them.

name: reflection-method-find description: Find C# methods across every loaded assembly by name / type / parameters — including private methods. Returns serialized MethodData entries usable as schemas for 'reflection-method-call'. metadata: generated-by: mcp-plugin-dotnet

Method C# / Find

Find method in the project using C# Reflection. It looks for all assemblies in the project and finds method by its name, class name and parameters. Even private methods are available. Use 'reflection-method-call' to call the method after finding it.

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 0 — ignore filter): 0 ignore, 1 count matches, 2 equals.

Output

On match, returns a [Success] Found N method(s): line followed by a JSON dump of every method's MethodData. Pass any single entry to 'reflection-method-call' as its filter.

How to Call

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

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

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

Or pipe via stdin (recommended):

unity-mcp-cli run-tool reflection-method-find --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' (default value), 1 - parameters count is the same, 2 - equals. |

Input JSON Schema

{
  "type": "object",
  "properties": {
    "filter": {
      "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef"
    },
    "knownNamespace": {
      "type": "boolean"
    },
    "typeNameMatchLevel": {
      "type": "integer"
    },
    "methodNameMatchLevel": {
      "type": "integer"
    },
    "parametersMatchLevel": {
      "type": "integer"
    }
  },
  "$defs": {
    "System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter",
        "description": "Parameter of a method. Contains type and name of the parameter."
      }
    },
    "com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter": {
      "type": "object",
      "properties": {
        "typeName": {
          "type": "string",
          "description": "Type of the parameter including namespace. Sample: 'System.String', 'System.Int32', 'UnityEngine.GameObject', etc."
        },
        "name": {
          "type": "string",
          "description": "Name of the parameter. It may be empty if the name is unknown."
        }
      },
      "description": "Parameter of a method. Contains type and name of the parameter."
    },
    "com.IvanMurzak.ReflectorNet.Model.MethodRef": {
      "type": "object",
      "properties": {
        "namespace": {
          "type": "string",
          "description": "Namespace of the class. It may be empty if the class is in the global namespace or the namespace is unknown."
        },
        "typeName": {
          "type": "string",
          "description": "Class name, or substring a class name. It may be empty if the class is unknown."
        },
        "methodName": {
          "type": "string",
          "description": "Method name, or substring of the method name. It may be empty if the method is unknown."
        },
        "inputParameters": {
          "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)",
          "description": "List of input parameters. Can be null if the method has no parameters or the parameters are unknown."
        }
      },
      "description": "Method reference. Used to find method in codebase of the project."
    }
  },
  "required": [
    "filter"
  ]
}

Output

Output JSON Schema

{
  "type": "object",
  "properties": {
    "result": {
      "type": "string"
    }
  },
  "required": [
    "result"
  ]
}

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/find-c-methods-via-reflection-mu99jncl' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/find-c-methods-via-reflection-mu99jncl/download' --output '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md.part' && mv '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md.part' '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md' && test -s '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/reflection-method-find' && cp -R '.skill-downloads/find-c-methods-via-reflection-mu99jncl' '.claude/skills/reflection-method-find'

Cursor
test -f '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md' && test -s '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/reflection-method-find' && cp -R '.skill-downloads/find-c-methods-via-reflection-mu99jncl' '.cursor/skills/reflection-method-find'

Codex
test -f '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md' && test -s '.skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/reflection-method-find' && cp -R '.skill-downloads/find-c-methods-via-reflection-mu99jncl' '.agents/skills/reflection-method-find'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/find-c-methods-via-reflection-mu99jncl'

openskills read 'find-c-methods-via-reflection-mu99jncl'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/find-c-methods-via-reflection-mu99jncl/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills