get_diagnostics
[diagnostics]
Lists compact TypeScript and JavaScript diagnostics for a file, project, or loaded workspace.
Try it locally in the TGlider playground
Parameters
| 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'. Default: "all" |
| diagnosticCodes | json | No | Optional array of TypeScript diagnostic codes. |
| includeDeclarationFiles | boolean | No | Include diagnostics from declaration files. Default: false |
| includeGenerated | boolean | No | Include diagnostics from generated-looking files. Default: false |
| skip | number | No | Number of matching results to skip. Default: 0 |
| take | number | No | Maximum 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.