[diagnostics]
Lists compact TypeScript and JavaScript diagnostics for a file, project, or loaded workspace.
TypeScript diagnostics are the fastest objective signal for broken imports, type errors, and project configuration problems.
The model can request filtered or grouped diagnostics instead of reading a full build or typecheck transcript.
Try it locally in the TGlider playground
| Name | Type | Required | Description |
|---|---|---|---|
| filePath | string | No | Workspace-relative or absolute file path. |
| projectName | string | No | Optional loaded project name to scope the query. |
| severity | string | No | Filter by 'all', 'error', 'warning', 'suggestion', or 'message'. |
| diagnosticCodes | json | No | Optional array of TypeScript diagnostic codes. |
| includeDeclarationFiles | boolean | No | Include diagnostics from declaration files. |
| includeGenerated | boolean | No | Include diagnostics from generated-looking files. |
| skip | number | No | Number of matching results to skip. |
| take | number | No | Maximum number of matching results to return. |
List workspace TypeScript errors
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_diagnostics",
"arguments": {
"severity": "error"
}
}
}Returns diagnostics with file, range, category, code, message, and paging metadata.