Skip to main content
Glama
c0sc0s
by c0sc0s

Get Diagnostics

get_diagnostics

Analyze TypeScript files for syntax and semantic errors using project-aware configuration to identify coding issues and ensure code quality.

Instructions

Return TypeScript syntactic and semantic diagnostics for a single file using project-aware configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
workspaceRootNo
projectTsconfigPathNo

Implementation Reference

  • Registration and handler implementation for 'get_diagnostics' tool.
    server.registerTool(
      "get_diagnostics",
      {
        title: "Get Diagnostics",
        description: "Return TypeScript syntactic and semantic diagnostics for a single file using project-aware configuration.",
        inputSchema: diagnosticsSchema,
      },
      async (args: DiagnosticsArgs) => {
        const { diagnostics, project } = cache.getDiagnosticsWithMetadata(args.file, args);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ file: args.file, diagnostics, project }, null, 2),
            },
          ],
          structuredContent: {
            file: args.file,
            diagnostics,
            project,
          },
        };
      },
    );
  • Input schema definition for 'get_diagnostics'.
    const diagnosticsSchema = z.object({
      file: z.string().min(1),
      workspaceRoot: z.string().min(1).optional(),
      projectTsconfigPath: z.string().min(1).optional(),
    });
Behavior3/5

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

With no annotations, the description carries the full burden. 'Return' correctly implies a read-only operation, and 'project-aware' hints at configuration resolution behavior. However, it omits error handling, performance characteristics, and cache behavior.

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

Conciseness5/5

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

Single efficient sentence with no redundancy. Every clause contributes essential information: operation (Return), resource (diagnostics), type (syntactic/semantic), scope (single file), and mechanism (project-aware configuration).

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

Completeness2/5

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

With three undocumented parameters (0% coverage), no output schema, and no annotations, the description is insufficient. It explains the concept of diagnostics but fails to document parameter semantics or return structure adequately for the complexity.

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

Parameters2/5

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

Schema coverage is 0%, requiring the description to compensate. It loosely maps 'single file' to the file parameter and 'project-aware configuration' to workspaceRoot/projectTsconfigPath, but provides no format details, path requirements, or guidance on when optional parameters are needed.

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

Purpose5/5

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

The description clearly states the tool returns TypeScript syntactic and semantic diagnostics, distinguishing it from sibling navigation tools like get_definition or get_references. It specifies the scope (single file) and mechanism (project-aware configuration).

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 phrase 'using project-aware configuration' implies usage context (when project context is needed), but there are no explicit when-to-use guidelines, prerequisites, or comparisons to alternatives like reload_project or discover_repository_structure.

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/c0sc0s/agent-workspace-mcp'

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