Skip to main content
Glama
c0sc0s
by c0sc0s

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(),
    });

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