get_diagnostics

[diagnostics]

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

Why this tool exists

TypeScript diagnostics are the fastest objective signal for broken imports, type errors, and project configuration problems.

How it helps the agent

The model can request filtered or grouped diagnostics instead of reading a full build or typecheck transcript.

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'.
diagnosticCodesjsonNoOptional array of TypeScript diagnostic codes.
includeDeclarationFilesbooleanNoInclude diagnostics from declaration files.
includeGeneratedbooleanNoInclude diagnostics from generated-looking files.
skipnumberNoNumber of matching results to skip.
takenumberNoMaximum number of matching results to return.

Examples

List workspace TypeScript errors

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.

↑/↓ NavigateEnter OpenSpace Expand