Skip to main content
Glama

review.preprocess

Normalizes Re:VIEW manuscript files by preprocessing JavaScript input, adding metadata, and preparing files for validation to prevent common writing errors.

Instructions

JS preprocessor only - normalizes input and adds metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYes
patternNo
outputNo
statsNo

Implementation Reference

  • Core implementation of the review.preprocess tool. Handles options, logs skip message, and returns a success response with stats (currently skips actual preprocessing).
    export async function preprocessCommand(options: PreprocessOptions) { const { pattern = "articles/**/*.re", output = ".out", stats = true, cwd } = options; // Skip preprocessing for now since review-macro-shims is not available // In production, this would call the actual preprocessor console.log("[preprocess] Skipping JS preprocessing (using standard Re:VIEW)"); return { success: true, output: "Preprocessing skipped - using standard Re:VIEW", stats: stats ? { filesProcessed: 0, macrosExpanded: 0, warnings: [] } : null }; }
  • Tool definition including name, description, and input schema registered in the tools list for ListToolsRequest.
    { name: "review.preprocess", description: "JS preprocessor only - normalizes input and adds metadata", inputSchema: { type: "object", properties: { cwd: { type: "string" }, pattern: { type: "string" }, output: { type: "string" }, stats: { type: "boolean" } }, required: ["cwd"] } },
  • src/index.ts:543-555 (registration)
    Switch case in CallToolRequestSchema handler that dispatches to hybridCommands.preprocess and returns the result.
    case "review.preprocess": { const result = await hybridCommands.preprocess({ cwd: args.cwd as string, pattern: args.pattern as string | undefined, output: args.output as string | undefined, stats: args.stats as boolean | undefined }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; }
  • TypeScript interface defining the input parameters for the preprocessCommand function.
    export interface PreprocessOptions { pattern?: string; output?: string; stats?: boolean; cwd: string; }
  • Exports the preprocessCommand as hybridCommands.preprocess for use in index.ts.
    export const hybridCommands = { preprocess: preprocessCommand, buildPdfHybrid: buildPdfHybridCommand, checkRubyExtensions: checkRubyExtensionsCommand, testMapfile: testMapfileCommand };

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