Skip to main content
Glama

Scan diagnostics

scan_diagnostics
Read-onlyIdempotent

Lists errors and warnings found while statically reading test files, helping identify why tests are missing, not loaded, or affected by runner/config issues.

Instructions

Lists the problems test-inventory found while reading the test files: level error means tests may be missing from the other answers (a file that failed to parse, an import it could not follow), or that the runner fails the file or the run (a Vitest tag the config does not define, a .only that forbidOnly fails); level warning means a value is missing or approximate (a title built at run time, a config value computed at run time, a file no config runs). They are about reading the code, not test failures. Use it when another tool reports scanErrors, or to check why a test is missing or notLoaded. Answers are paged: follow nextCursor. Example: {"levels": ["error"]}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "scan_diagnostics"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoKeeps problems in this file, or in the files under this folder, relative to `directory`.
codesNoKeeps problems with these codes.
limitNoThe most items to return.
cursorNonextCursor from the previous answer, for the next page. Keep the other arguments the same.
levelsNoKeeps problems of these levels.
patternsNoGlobs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run.
directoryNoA folder inside the project to scan, relative to its root, such as "packages/web". Default: the root.
frameworkNoThe test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses.
expandCasesNoLists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pass the same value to get_tests. Default: false, one test per declaration with caseCount.

Output Schema

NameRequiredDescriptionDefault
hintYes
totalYesAll matching items, on every page.
frameworkYes
nextCursorYes
diagnosticsYesOne page of problems, in file order.
frameworkVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed6 schema fields changedv0.7.0
    • changedInput schema / properties / codes / items / enum
      Previous value: -[
      -  "unresolved-test-import",
      -  "parse-error",
      -  "read-error",
      -  "framework-mismatch",
      -  "unresolved-tag",
      -  "unresolved-annotation",
      -  "unresolved-cases",
      -  "test-in-loop",
      -  "dynamic-title",
      -  "duplicate-title",
      -  "duplicate-id",
      -  "internal-error",
      -  "invalid-chain",
      -  "skip-without-body",
      -  "test-without-body",
      -  "describe-not-called",
      -  "async-describe",
      -  "nested-test",
      -  "tag-without-at",
      -  "removed-api",
      -  "only-in-skipped-describe",
      -  "config-may-change-state",
      -  "undefined-tag",
      -  "symlink-ignored",
      -  "invalid-import",
      -  "globals-not-enabled",
      -  "unknown-framework-version",
      -  "unsupported-framework-version",
      -  "local-test-object",
      -  "state-in-helper",
      -  "unresolved-option",
      -  "dynamic-reason",
      -  "no-files-matched",
      -  "unsupported-file",
      -  "approximate-framework-version",
      -  "test-in-function",
      -  "empty-title",
      -  "bench-outside-benchmark-file",
      -  "config-value-unknown",
      -  "file-not-run",
      -  "forbidden-only",
      -  "dependency-not-followed"
      -]New value: +[
      +  "unresolved-test-import",
      +  "parse-error",
      +  "read-error",
      +  "framework-mismatch",
      +  "unresolved-tag",
      +  "unresolved-annotation",
      +  "unresolved-cases",
      +  "cases-not-expanded",
      +  "test-in-loop",
      +  "dynamic-title",
      +  "duplicate-title",
      +  "duplicate-id",
      +  "internal-error",
      +  "invalid-chain",
      +  "skip-without-body",
      +  "test-without-body",
      +  "describe-not-called",
      +  "async-describe",
      +  "describe-throws",
      +  "nested-test",
      +  "tag-without-at",
      +  "removed-api",
      +  "invalid-fixture-argument",
      +  "only-in-skipped-describe",
      +  "config-may-change-state",
      +  "undefined-tag",
      +  "symlink-ignored",
      +  "invalid-import",
      +  "globals-not-enabled",
      +  "unknown-framework-version",
      +  "unsupported-framework-version",
      +  "local-test-object",
      +  "state-in-helper",
      +  "unresolved-option",
      +  "dynamic-reason",
      +  "no-files-matched",
      +  "unsupported-file",
      +  "approximate-framework-version",
      +  "test-in-function",
      +  "empty-title",
      +  "bench-outside-benchmark-file",
      +  "config-value-unknown",
      +  "file-not-run",
      +  "forbidden-only",
      +  "dependency-not-followed"
      +]
    • addedInput schema / properties / expandCases
      Added value: +{
      +  "description": "Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pass the same value to get_tests. Default: false, one test per declaration with caseCount.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / framework / description
      Previous value: -"The test runner. Default: the one the server was started with."New value: +"The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses."
    • changedInput schema / properties / framework / enum
      Previous value: -[
      -  "playwright",
      -  "vitest"
      -]New value: +[
      +  "playwright",
      +  "vitest",
      +  "jest",
      +  "mocha",
      +  "jasmine",
      +  "cypress",
      +  "webdriverio",
      +  "node",
      +  "bun"
      +]
    • changedOutput schema / definitions / DiagnosticCode / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "unresolved-test-import",
      -      "parse-error",
      -      "read-error",
      -      "framework-mismatch",
      -      "unresolved-tag",
      -      "unresolved-annotation",
      -      "unresolved-cases",
      -      "test-in-loop",
      -      "dynamic-title",
      -      "duplicate-title",
      -      "duplicate-id",
      -      "internal-error",
      -      "invalid-chain",
      -      "skip-without-body",
      -      "test-without-body",
      -      "describe-not-called",
      -      "async-describe",
      -      "nested-test",
      -      "tag-without-at",
      -      "removed-api",
      -      "only-in-skipped-describe",
      -      "config-may-change-state",
      -      "undefined-tag",
      -      "symlink-ignored",
      -      "invalid-import",
      -      "globals-not-enabled",
      -      "unknown-framework-version",
      -      "unsupported-framework-version",
      -      "local-test-object",
      -      "state-in-helper",
      -      "unresolved-option",
      -      "dynamic-reason",
      -      "no-files-matched",
      -      "unsupported-file",
      -      "approximate-framework-version",
      -      "test-in-function",
      -      "empty-title",
      -      "bench-outside-benchmark-file",
      -      "config-value-unknown",
      -      "file-not-run",
      -      "forbidden-only",
      -      "dependency-not-followed"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "unresolved-test-import",
      +      "parse-error",
      +      "read-error",
      +      "framework-mismatch",
      +      "unresolved-tag",
      +      "unresolved-annotation",
      +      "unresolved-cases",
      +      "cases-not-expanded",
      +      "test-in-loop",
      +      "dynamic-title",
      +      "duplicate-title",
      +      "duplicate-id",
      +      "internal-error",
      +      "invalid-chain",
      +      "skip-without-body",
      +      "test-without-body",
      +      "describe-not-called",
      +      "async-describe",
      +      "describe-throws",
      +      "nested-test",
      +      "tag-without-at",
      +      "removed-api",
      +      "invalid-fixture-argument",
      +      "only-in-skipped-describe",
      +      "config-may-change-state",
      +      "undefined-tag",
      +      "symlink-ignored",
      +      "invalid-import",
      +      "globals-not-enabled",
      +      "unknown-framework-version",
      +      "unsupported-framework-version",
      +      "local-test-object",
      +      "state-in-helper",
      +      "unresolved-option",
      +      "dynamic-reason",
      +      "no-files-matched",
      +      "unsupported-file",
      +      "approximate-framework-version",
      +      "test-in-function",
      +      "empty-title",
      +      "bench-outside-benchmark-file",
      +      "config-value-unknown",
      +      "file-not-run",
      +      "forbidden-only",
      +      "dependency-not-followed"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedOutput schema / definitions / Framework / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "playwright",
      -      "vitest"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "playwright",
      +      "vitest",
      +      "jest",
      +      "mocha",
      +      "jasmine",
      +      "cypress",
      +      "webdriverio",
      +      "node",
      +      "bun"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  3. Changed3 schema fields changedv0.4.1
    • changedInput schema / properties / codes / items / enum
      Previous value: -[
      -  "unresolved-test-import",
      -  "parse-error",
      -  "read-error",
      -  "framework-mismatch",
      -  "unresolved-tag",
      -  "unresolved-annotation",
      -  "unresolved-cases",
      -  "test-in-loop",
      -  "dynamic-title",
      -  "duplicate-title",
      -  "duplicate-id",
      -  "internal-error",
      -  "invalid-chain",
      -  "skip-without-body",
      -  "test-without-body",
      -  "describe-not-called",
      -  "async-describe",
      -  "nested-test",
      -  "tag-without-at",
      -  "removed-api",
      -  "only-in-skipped-describe",
      -  "config-may-change-state",
      -  "symlink-ignored",
      -  "invalid-import",
      -  "globals-not-enabled",
      -  "unknown-framework-version",
      -  "unsupported-framework-version",
      -  "local-test-object",
      -  "state-in-helper",
      -  "unresolved-option",
      -  "dynamic-reason",
      -  "no-files-matched",
      -  "unsupported-file",
      -  "approximate-framework-version",
      -  "test-in-function",
      -  "empty-title",
      -  "bench-outside-benchmark-file"
      -]New value: +[
      +  "unresolved-test-import",
      +  "parse-error",
      +  "read-error",
      +  "framework-mismatch",
      +  "unresolved-tag",
      +  "unresolved-annotation",
      +  "unresolved-cases",
      +  "test-in-loop",
      +  "dynamic-title",
      +  "duplicate-title",
      +  "duplicate-id",
      +  "internal-error",
      +  "invalid-chain",
      +  "skip-without-body",
      +  "test-without-body",
      +  "describe-not-called",
      +  "async-describe",
      +  "nested-test",
      +  "tag-without-at",
      +  "removed-api",
      +  "only-in-skipped-describe",
      +  "config-may-change-state",
      +  "undefined-tag",
      +  "symlink-ignored",
      +  "invalid-import",
      +  "globals-not-enabled",
      +  "unknown-framework-version",
      +  "unsupported-framework-version",
      +  "local-test-object",
      +  "state-in-helper",
      +  "unresolved-option",
      +  "dynamic-reason",
      +  "no-files-matched",
      +  "unsupported-file",
      +  "approximate-framework-version",
      +  "test-in-function",
      +  "empty-title",
      +  "bench-outside-benchmark-file",
      +  "config-value-unknown",
      +  "file-not-run",
      +  "forbidden-only",
      +  "dependency-not-followed"
      +]
    • changedInput schema / properties / patterns / description
      Previous value: -"Globs of the test files, relative to `directory`, such as [\"tests/**/*.spec.ts\"]. Default: the ones the server was started with."New value: +"Globs of the test files, relative to `directory`, such as [\"tests/**/*.spec.ts\"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run."
    • changedOutput schema / definitions / DiagnosticCode / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "unresolved-test-import",
      -      "parse-error",
      -      "read-error",
      -      "framework-mismatch",
      -      "unresolved-tag",
      -      "unresolved-annotation",
      -      "unresolved-cases",
      -      "test-in-loop",
      -      "dynamic-title",
      -      "duplicate-title",
      -      "duplicate-id",
      -      "internal-error",
      -      "invalid-chain",
      -      "skip-without-body",
      -      "test-without-body",
      -      "describe-not-called",
      -      "async-describe",
      -      "nested-test",
      -      "tag-without-at",
      -      "removed-api",
      -      "only-in-skipped-describe",
      -      "config-may-change-state",
      -      "symlink-ignored",
      -      "invalid-import",
      -      "globals-not-enabled",
      -      "unknown-framework-version",
      -      "unsupported-framework-version",
      -      "local-test-object",
      -      "state-in-helper",
      -      "unresolved-option",
      -      "dynamic-reason",
      -      "no-files-matched",
      -      "unsupported-file",
      -      "approximate-framework-version",
      -      "test-in-function",
      -      "empty-title",
      -      "bench-outside-benchmark-file"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "unresolved-test-import",
      +      "parse-error",
      +      "read-error",
      +      "framework-mismatch",
      +      "unresolved-tag",
      +      "unresolved-annotation",
      +      "unresolved-cases",
      +      "test-in-loop",
      +      "dynamic-title",
      +      "duplicate-title",
      +      "duplicate-id",
      +      "internal-error",
      +      "invalid-chain",
      +      "skip-without-body",
      +      "test-without-body",
      +      "describe-not-called",
      +      "async-describe",
      +      "nested-test",
      +      "tag-without-at",
      +      "removed-api",
      +      "only-in-skipped-describe",
      +      "config-may-change-state",
      +      "undefined-tag",
      +      "symlink-ignored",
      +      "invalid-import",
      +      "globals-not-enabled",
      +      "unknown-framework-version",
      +      "unsupported-framework-version",
      +      "local-test-object",
      +      "state-in-helper",
      +      "unresolved-option",
      +      "dynamic-reason",
      +      "no-files-matched",
      +      "unsupported-file",
      +      "approximate-framework-version",
      +      "test-in-function",
      +      "empty-title",
      +      "bench-outside-benchmark-file",
      +      "config-value-unknown",
      +      "file-not-run",
      +      "forbidden-only",
      +      "dependency-not-followed"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  4. Changed2 schema fields changedv0.2.0
    • changedInput schema / properties / codes / items / enum
      Previous value: -[
      -  "unresolved-test-import",
      -  "parse-error",
      -  "read-error",
      -  "framework-mismatch",
      -  "unresolved-tag",
      -  "unresolved-annotation",
      -  "unresolved-cases",
      -  "test-in-loop",
      -  "dynamic-title",
      -  "duplicate-title",
      -  "duplicate-id",
      -  "internal-error",
      -  "invalid-chain",
      -  "skip-without-body",
      -  "test-without-body",
      -  "describe-not-called",
      -  "async-describe",
      -  "nested-test",
      -  "tag-without-at",
      -  "removed-api",
      -  "only-in-skipped-describe",
      -  "config-may-change-state",
      -  "symlink-ignored",
      -  "invalid-import",
      -  "globals-not-enabled",
      -  "unknown-framework-version",
      -  "unsupported-framework-version",
      -  "local-test-object",
      -  "state-in-helper",
      -  "unresolved-option",
      -  "dynamic-reason",
      -  "no-files-matched",
      -  "unsupported-file",
      -  "approximate-framework-version",
      -  "test-in-function"
      -]New value: +[
      +  "unresolved-test-import",
      +  "parse-error",
      +  "read-error",
      +  "framework-mismatch",
      +  "unresolved-tag",
      +  "unresolved-annotation",
      +  "unresolved-cases",
      +  "test-in-loop",
      +  "dynamic-title",
      +  "duplicate-title",
      +  "duplicate-id",
      +  "internal-error",
      +  "invalid-chain",
      +  "skip-without-body",
      +  "test-without-body",
      +  "describe-not-called",
      +  "async-describe",
      +  "nested-test",
      +  "tag-without-at",
      +  "removed-api",
      +  "only-in-skipped-describe",
      +  "config-may-change-state",
      +  "symlink-ignored",
      +  "invalid-import",
      +  "globals-not-enabled",
      +  "unknown-framework-version",
      +  "unsupported-framework-version",
      +  "local-test-object",
      +  "state-in-helper",
      +  "unresolved-option",
      +  "dynamic-reason",
      +  "no-files-matched",
      +  "unsupported-file",
      +  "approximate-framework-version",
      +  "test-in-function",
      +  "empty-title",
      +  "bench-outside-benchmark-file"
      +]
    • changedOutput schema / definitions / DiagnosticCode / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "unresolved-test-import",
      -      "parse-error",
      -      "read-error",
      -      "framework-mismatch",
      -      "unresolved-tag",
      -      "unresolved-annotation",
      -      "unresolved-cases",
      -      "test-in-loop",
      -      "dynamic-title",
      -      "duplicate-title",
      -      "duplicate-id",
      -      "internal-error",
      -      "invalid-chain",
      -      "skip-without-body",
      -      "test-without-body",
      -      "describe-not-called",
      -      "async-describe",
      -      "nested-test",
      -      "tag-without-at",
      -      "removed-api",
      -      "only-in-skipped-describe",
      -      "config-may-change-state",
      -      "symlink-ignored",
      -      "invalid-import",
      -      "globals-not-enabled",
      -      "unknown-framework-version",
      -      "unsupported-framework-version",
      -      "local-test-object",
      -      "state-in-helper",
      -      "unresolved-option",
      -      "dynamic-reason",
      -      "no-files-matched",
      -      "unsupported-file",
      -      "approximate-framework-version",
      -      "test-in-function"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "unresolved-test-import",
      +      "parse-error",
      +      "read-error",
      +      "framework-mismatch",
      +      "unresolved-tag",
      +      "unresolved-annotation",
      +      "unresolved-cases",
      +      "test-in-loop",
      +      "dynamic-title",
      +      "duplicate-title",
      +      "duplicate-id",
      +      "internal-error",
      +      "invalid-chain",
      +      "skip-without-body",
      +      "test-without-body",
      +      "describe-not-called",
      +      "async-describe",
      +      "nested-test",
      +      "tag-without-at",
      +      "removed-api",
      +      "only-in-skipped-describe",
      +      "config-may-change-state",
      +      "symlink-ignored",
      +      "invalid-import",
      +      "globals-not-enabled",
      +      "unknown-framework-version",
      +      "unsupported-framework-version",
      +      "local-test-object",
      +      "state-in-helper",
      +      "unresolved-option",
      +      "dynamic-reason",
      +      "no-files-matched",
      +      "unsupported-file",
      +      "approximate-framework-version",
      +      "test-in-function",
      +      "empty-title",
      +      "bench-outside-benchmark-file"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  5. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered; the description adds the substantive behavior: what 'error' versus 'warning' actually mean in this data model, and that results are paged with nextCursor. It stops short of ordering or scope-of-scan caveats, so not a 5.

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?

Front-loaded with the purpose, then level semantics, then usage, then paging — a sensible order with no filler. The first sentence is a long run-on carrying multiple parenthetical examples, which costs some readability but each clause contributes information.

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?

Complete on the essentials for a 9-parameter, read-only inspection tool: what it returns conceptually, how levels are interpreted, when to call it, and how to page. The one gap is that the large codes enumeration is only glossed via examples in the description, though the schema carries the individual values.

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 every parameter is already documented, and the description adds only a single usage example ({"levels": ["error"]}) plus the paging instruction. The many filter codes and options are left entirely to the schema; baseline 3 is appropriate.

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?

States a specific verb plus resource: lists the problems test-inventory found while reading test files, and immediately disambiguates with 'They are about reading the code, not test failures.' That distinction separates it from siblings like get_tests and test_summary without opening their schemas.

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

Usage Guidelines5/5

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

Gives explicit trigger conditions ('Use it when another tool reports scanErrors, or to check why a test is missing or notLoaded') and an explicit exclusion (not for test failures). The agent knows both when to reach for this tool and when not to.

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