get_diagnostics

[diagnostics]

Gets diagnostics (warnings, errors) for the loaded solution/project. Use includeAnalyzers=true to include analyzer/IDE diagnostics. Workspace load diagnostics are available via server_status with includeWorkspaceDiagnostics=true.

Why this tool exists

Diagnostics are the fastest objective signal that a change broke something or that an existing hotspot needs attention.

How it helps the agent

The model can ask for filtered, paged, or grouped diagnostics before and after edits instead of waiting for a full build transcript.

Try it locally in the GliderMCP playground

Parameters

NameTypeRequiredDescription
filePathstringNoOptional file path filter.
projectNamestringNoOptional project name filter.
includeAnalyzersbooleanNoInclude analyzer/IDE diagnostics. Default is false.
summaryOnlybooleanNoWhen true, returns summary counts only. Default is false.
severitystringNoMinimum severity: 'error', 'warning', 'info', or 'hidden'. Default is 'warning'.
categorystringNoOptional category filter (e.g., 'Compiler', 'Style').
idPrefixstringNoOptional diagnostic ID prefix filter (e.g., 'CS', 'CA', 'IDE').
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
sortBystringNoOptional sort: 'severity', 'filePath', 'id', 'lineNumber', 'projectName'.
sortOrderstringNoSort order: 'asc' (default) or 'desc'.
skipnumberNoPagination offset. Default is 0.
takenumberNoPagination size. Default is 200.

Examples

Get warnings and errors (default)

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_diagnostics",
    "arguments": {}
  }
}
Response
{
  "success": true,
  "data": {
    "diagnosticCount": 3,
    "errorCount": 1,
    "warningCount": 2,
    "infoCount": 0,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 3,
      "total": 3
    },
    "diagnostics": [
      {
        "id": "CS1002",
        "severity": "Error",
        "message": "; expected",
        "filePath": "/path/to/File.cs",
        "lineNumber": 42,
        "column": 17,
        "endLineNumber": 42,
        "endColumn": 18,
        "category": "Syntax",
        "projectName": "MyProject"
      }
    ]
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Get error diagnostics only

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_diagnostics",
    "arguments": {
      "severity": "error"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "diagnosticCount": 3,
    "errorCount": 1,
    "warningCount": 2,
    "infoCount": 0,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 3,
      "total": 3
    },
    "diagnostics": [
      {
        "id": "CS1002",
        "severity": "Error",
        "message": "; expected",
        "filePath": "/path/to/File.cs",
        "lineNumber": 42,
        "column": 17,
        "endLineNumber": 42,
        "endColumn": 18,
        "category": "Syntax",
        "projectName": "MyProject"
      }
    ]
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Summary view by project and severity

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_diagnostics",
    "arguments": {
      "summaryOnly": true,
      "severity": "warning"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "diagnosticCount": 3,
    "errorCount": 1,
    "warningCount": 2,
    "infoCount": 0,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 3,
      "total": 3
    },
    "diagnostics": [
      {
        "id": "CS1002",
        "severity": "Error",
        "message": "; expected",
        "filePath": "/path/to/File.cs",
        "lineNumber": 42,
        "column": 17,
        "endLineNumber": 42,
        "endColumn": 18,
        "category": "Syntax",
        "projectName": "MyProject"
      }
    ]
  },
  "meta": {
    "durationMs": 123,
    "cancelled": false,
    "timedOut": false,
    "timeoutMs": 1200000
  },
  "error": null
}

Response Notes

Returns compiler and analyzer diagnostics, optionally with paging and filtering. Workspace load diagnostics are not included.

↑/↓ NavigateEnter OpenSpace Expand