get_type_source

[analysis]

Gets source code for a type (bounded by max lines).

Why this tool exists

Agents need enough source and member detail to act, but whole files are often too much context.

How it helps the agent

These tools provide bounded, structured slices of types and methods so the model can inspect intent without flooding the prompt.

Parameters

NameTypeRequiredDescription
typeNamestringYesType name (simple or fully qualified).
projectNamestringNoOptional project name filter.
maxLinesnumberNoMax lines to return. Use 0 for unlimited. Default is 200.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).

Examples

Get type source

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_type_source",
    "arguments": {
      "typeName": "UserService"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "typeName": "UserService",
    "fullName": "MyApp.Services.UserService",
    "kind": "Class",
    "filePath": "/path/to/UserService.cs",
    "startLine": 1,
    "endLine": 120,
    "lineCount": 120,
    "truncated": true,
    "source": "..."
  },
  "error": null
}

Response Notes

Returns type source (possibly truncated)

↑/↓ NavigateEnter OpenSpace Expand