Browse documentation

get_diagnostics

[diagnostics]

Lists compact TypeScript and JavaScript diagnostics for a file, project, or loaded workspace.

Try it locally in the TGlider playground

Parameters

NameTypeRequiredDescription
filePathstringNoWorkspace-relative or absolute file path.
projectNamestringNoOptional loaded project name to scope the query.
severitystringNoFilter by 'all', 'error', 'warning', 'suggestion', or 'message'. Default: "all"
diagnosticCodesjsonNoOptional array of TypeScript diagnostic codes.
includeDeclarationFilesbooleanNoInclude diagnostics from declaration files. Default: false
includeGeneratedbooleanNoInclude diagnostics from generated-looking files. Default: false
skipnumberNoNumber of matching results to skip. Default: 0
takenumberNoMaximum number of matching results to return.

Examples

Replace sample paths and symbol keys with values from your workspace.

List workspace TypeScript errors

Arguments
{
  "severity": "error"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_diagnostics",
    "arguments": {
      "severity": "error"
    }
  }
}

Response Notes

Returns diagnostics with file, range, category, code, message, and paging metadata. When any contributing project was inferred without a tsconfig, scope.inferred, inferredProjectCount, and notes flag that diagnostics may be incomplete.