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
    };
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'normalizes input and adds metadata' without explaining what normalization entails, what metadata is added, whether this is a read-only or mutating operation, or any performance/error characteristics. It mentions 'JS preprocessor only' which hints at language specificity but doesn't elaborate on behavioral constraints.

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?

The description is extremely concise at just 8 words, with no wasted language. However, this brevity comes at the cost of being under-specified rather than efficiently informative. The single sentence is front-loaded but lacks necessary detail.

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

Completeness2/5

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

For a 4-parameter tool with no annotations, 0% schema coverage, and no output schema, the description is inadequate. It doesn't explain what the tool actually does with JS files, what normalization means, what metadata gets added, or what the expected output format would be. The context of 12 sibling tools suggests this is part of a review system, but the description doesn't situate this tool within that ecosystem.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for all 4 parameters, the description provides no information about what 'cwd', 'pattern', 'output', or 'stats' mean or how they should be used. The description doesn't compensate for the complete lack of parameter documentation in the schema, leaving all parameters semantically undefined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states it's a 'JS preprocessor' that 'normalizes input and adds metadata', which gives a vague purpose but doesn't specify what exactly gets normalized or what metadata is added. It distinguishes from siblings by mentioning 'JS' specifically, but doesn't clarify what resource it operates on or the exact transformation performed.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus the 12 sibling tools. The description doesn't mention prerequisites, alternatives, or specific contexts where this preprocessor should be applied versus other review tools like 'review.lint' or 'review.security.validate-mapfile'.

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

Install Server

Other Tools

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