Skip to main content
Glama

review.lint

Validate Re:VIEW manuscript files by compiling to LaTeX and analyzing warnings to identify common errors before publishing.

Instructions

Run a fast sanity check by compiling each .re to latex and parsing stderr warnings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYes

Implementation Reference

  • The handler for 'review.lint' tool. Compiles each .re file listed in catalog.yml using 'review-compile --target=latex', catches errors, parses stderr with parseStderr to collect diagnostics, and returns them as JSON.
    case "review.lint": { const files = await pickFilesFromCatalog(args.cwd as string); const diagnostics: any[] = []; for (const f of files) { try { await withBundle(args.cwd as string, ["review-compile", "--target=latex", "--footnotetext", f]); } catch (e: any) { const stderr = e?.stderr || e?.message || ""; diagnostics.push(...parseStderr(stderr, f)); continue; } } return { content: [ { type: "text", text: JSON.stringify({ diagnostics }) } ] }; }
  • Tool definition including name, description, and input schema (requires 'cwd' string) for listing in ListTools response.
    { name: "review.lint", description: "Run a fast sanity check by compiling each .re to latex and parsing stderr warnings.", inputSchema: { type: "object", properties: { cwd: { type: "string" } }, required: ["cwd"] } },
  • Helper function to parse stderr from review-compile, extracting diagnostics for invalid block starts and duplicate IDs.
    function parseStderr(stderr: string, fallbackFile?: string) { const diags: any[] = []; const lines = stderr.split(/\r?\n/); const reInvalid = /^([^\s:]+):(\d+):\s+`\/\/'\s+seen.*?:\s+"(.+)"$/; // 09_xx.re:42: `//' seen ... const reDupId = /warning:\s+duplicate ID:/i; for (let raw of lines) { const line = raw.replace(/^\p{So}|^\s*⚠\s*WARN\s*/u, "").trim(); const m = line.match(reInvalid); if (m) { diags.push({ file: m[1], line: Number(m[2]), severity: "warning", message: `Invalid block start '//': ${m[3]}` }); continue; } if (reDupId.test(line)) { diags.push({ file: fallbackFile ?? null, line: null, severity: "warning", message: "Duplicate/empty ID detected" }); } } return diags; }

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/dsgarage/ReviewMCP'

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