sharphy_generate_wrapper
Generates strongly-typed C# wrapper code using .NET 8+ UnsafeAccessor attributes to access private members and fields with zero reflection overhead, writing a .cs file for testing internal APIs.
Instructions
Generates strongly-typed C# wrapper source code utilizing .NET 8+ [UnsafeAccessor] attributes to access private members and fields with zero reflection overhead. Use this tool when testing or accessing inaccessible internal/private APIs. Do NOT use for bytecode modification (use 'sharphy_patch_il'). Mutates disk by writing a new C# (.cs) source file to outputPath.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"assemblyPath": "<assemblyPath>",
"typeName": "<typeName>",
"outputPath": "<outputPath>"
},
"name": "sharphy_generate_wrapper"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| typeName | Yes | Fully qualified target type name | |
| outputPath | Yes | Output C# source file path (.cs) | |
| assemblyPath | Yes | Path to the target assembly |