Skip to main content
Glama

Check JavaScript without writing it

validate_blocks
Read-only

Parse block code and code files to report syntax errors and diagnostics without writing to a workspace, so you can catch typos before a rejected write.

Instructions

Parses block code and code files and reports syntax errors WITHOUT touching any workspace — no workspaceId, nothing written, nothing to undo if it fails. Use it freely while drafting or fixing a block instead of discovering a typo from a rejected write. Returns { valid, checkedBlocks, checkedFiles, diagnostics[] } with the line and column of each problem. Note import "utils.js"; / import "zod@4.4.3"; lines are valid and are NOT errors.

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": "validate_blocks"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoCode files to parse. Only .js files are parsed.
blocksNoBlocks to parse. A block with no `type` is treated as Process.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.53.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true; the description goes well beyond that by spelling out 'no workspaceId, nothing written, nothing to undo if it fails', which tells the agent there are zero side effects and no cleanup burden. It also states the exact return shape 'Returns { valid, checkedBlocks, checkedFiles, diagnostics[] } with the line and column of each problem' and flags a non-obvious semantic exception (import lines are valid, not errors).

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?

Four tight sentences ordered by importance: what it does, when to use it, what it returns, and the one gotcha. No filler, and the 'WITHOUT touching any workspace' constraint is front-loaded where an agent will read it first.

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

Completeness5/5

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

Only two optional parameters at full schema coverage, no output schema — and the description compensates by describing the return object and diagnostic contents. Everything an agent needs to call this correctly and interpret the result is present.

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 the baseline is 3; the schema already documents files/blocks, file types, code, handlerCode and schedule fields thoroughly. The description adds no per-parameter meaning beyond the schema, leaving it at baseline even though the tool-level behavior is well explained.

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 and resource ('Parses block code and code files and reports syntax errors') plus the critical scope qualifier 'WITHOUT touching any workspace'. An agent can immediately tell this is a pure validation operation, not a write, which separates it from the mutation siblings on the list.

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

Usage Guidelines4/5

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

Gives concrete when-to-use guidance: 'Use it freely while drafting or fixing a block instead of discovering a typo from a rejected write' — it frames the tool as a pre-flight check before a write. It stops short of naming a specific sibling write tool, so it is clear context rather than explicit routing.

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