Skip to main content
Glama

Get TypeScript diagnostics

ast_get_diagnostics
Read-onlyIdempotent

Retrieve normalized TypeScript diagnostics for an entire project or a single file, with configurable limits and offsets. Get bounded error results to verify code health before applying write operations.

Instructions

Returns bounded normalized TypeScript diagnostics for a project or one source file. Existing errors are preserved as evidence for write-operation delta checks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results to return (1-500).
offsetNoZero-based result offset.
file_pathNoOptional project-relative or absolute file path. Omit for project diagnostics.
project_rootYesAbsolute project directory containing tsconfig.json, or the config path.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYes
totalYes
offsetYes
has_moreYes
diagnosticsYes
duration_msYes
error_countYes
next_offsetYes
warning_countYes
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is fully covered. The description adds that diagnostics are 'bounded and normalized' and that existing errors are 'preserved as evidence for write-operation delta checks' — useful context beyond annotations. However, it doesn't describe return format details or error behaviors (e.g., what happens if the path is invalid or project_root is malformed), though the output schema exists to cover return shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with no filler. The first sentence states the core function and scope, and the second sentence adds a meaningful behavioral context point about evidence preservation for delta checks. Efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the read-only annotations, 100% schema param coverage, and an output schema existing, the description does what's needed: it clarifies the project-vs-file scope and the role diagnostics play in delta checks. There's nothing critical missing for an agent to use this tool effectively, given the structured fields carry most of the burden.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all four parameters are already documented in the schema (limit, offset, file_path, project_root). The description adds the 'project vs single file' semantic for file_path by mentioning 'for a project or one source file,' which adds modest value beyond the schema's 'Optional project-relative or absolute file path.' With full schema coverage, the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns bounded normalized TypeScript diagnostics for a project or a single source file, using a specific verb ('returns') and resource ('TypeScript diagnostics'). It distinguishes itself from siblings, which handle file listing, symbol ops, and references — none of which overlap with diagnostics. A point is lost for not naming a sibling diagnostic tool explicitly, but among the listed siblings none is a direct alternative, so the differentiation is inherent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description indicates scope (project vs single file) which implies when to pass file_path vs omit it, but it doesn't explicitly state when to use this tool versus alternatives or provide exclusion conditions. The second sentence about 'evidence for write-operation delta checks' hints at usage context but is vague about specific workflows. No explicit when-not guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yailPeralta/ast-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server