search_fields
Search for fields in an assembly by name pattern. This tool reads the Field metadata table directly using dnfile — no ilspycmd required. Results include type information, visibility modifiers, and literal values for constants.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
assembly_path | string | Yes | — | Full path to the .NET assembly (.dll or .exe) |
pattern | string | Yes | — | Search pattern to match against field names |
type_filter | string | null | No | null | Only search fields in types containing this string |
namespace_filter | string | null | No | null | Only search in namespaces containing this string |
public_only | bool | No | false | Only return public fields |
constants_only | bool | No | false | Only return constant (literal) fields |
case_sensitive | bool | No | false | Whether pattern matching is case-sensitive |
use_regex | bool | No | false | Treat pattern as a regular expression |
Example
Section titled “Example”{ "tool": "search_fields", "arguments": { "assembly_path": "/path/to/MyApp.dll", "pattern": "Key", "constants_only": true }}result = await client.call_tool("search_fields", { "assembly_path": "/path/to/MyApp.dll", "pattern": "Key", "constants_only": True,})Response
Section titled “Response”Fields grouped by declaring type, each showing modifiers (public, static, const) and field name. Results support pagination via max_results and offset parameters.
Related Tools
Section titled “Related Tools”search_methods— find methods by name patternsearch_strings— search string literals in the #US heapget_metadata_summary— assembly-level statistics