find_member_in_hierarchy

[hierarchy]

Walks a member's override chain to find the original declaration. Requires a symbolKey.

Why this tool exists

Behavior in C# often lives behind inheritance, interfaces, overrides, and member chains.

How it helps the agent

The model can map base and derived relationships before editing contracts or investigating polymorphic behavior.

Parameters

NameTypeRequiredDescription
symbolKeystringYesOpaque symbolKey from search_symbols, resolve_symbol, get_symbol_at_position, or any tool that returns symbolKey. Not a name.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).

Examples

Find original declaration for an override

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_member_in_hierarchy",
    "arguments": {
      "symbolKey": "..."
    }
  }
}
Response
{
  "success": true,
  "data": {
    "symbolKey": "...",
    "chain": [
      {
        "name": "ToString",
        "fullName": "MyApp.Models.User.ToString()",
        "symbolKey": "...",
        "filePath": "/path/to/User.cs",
        "lineNumber": 42
      },
      {
        "name": "ToString",
        "fullName": "System.Object.ToString()",
        "symbolKey": "...",
        "filePath": null,
        "lineNumber": null
      }
    ],
    "original": {
      "name": "ToString",
      "fullName": "System.Object.ToString()",
      "symbolKey": "..."
    }
  },
  "error": null
}

Response Notes

Returns the override chain and original declaration

↑/↓ NavigateEnter OpenSpace Expand