Skip to main content
Glama

review.build-pdf-hybrid

Generate PDF documents from Re:VIEW manuscripts using a JS-to-Ruby hybrid pipeline that prioritizes PDF output quality and format compliance.

Instructions

JS→Ruby hybrid pipeline for PDF generation (PDF first priority)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYes
configNo
skipPreprocessNo

Implementation Reference

  • Core implementation of the tool: optionally preprocesses Re:VIEW files and runs `review-pdfmaker` to generate PDF artifacts.
    export async function buildPdfHybridCommand(options: BuildPdfOptions) {
      const {
        config = "config.yml",
        skipPreprocess = false,
        cwd
      } = options;
    
      const results: any[] = [];
    
      if (!skipPreprocess) {
        console.log("[build-pdf-hybrid] Running preprocessor...");
        const preprocessResult = await preprocessCommand({ cwd });
        results.push({ step: "preprocess", result: preprocessResult });
        
        if (!preprocessResult.success) {
          return {
            success: false,
            error: "Preprocessing failed",
            results
          };
        }
      }
    
      console.log("[build-pdf-hybrid] Building PDF with review-pdfmaker...");
      try {
        const pdfResult = await runCommand("review-pdfmaker", ["-c", config], { 
          cwd,
          useBundle: true 
        });
        
        results.push({ step: "pdf-build", result: { 
          success: true, 
          output: pdfResult.stdout 
        }});
    
        const pdfFiles = await findGeneratedPdf(cwd);
        
        return {
          success: true,
          results,
          artifacts: pdfFiles
        };
      } catch (error: any) {
        results.push({ step: "pdf-build", result: { 
          success: false, 
          error: error.message,
          stderr: error.stderr 
        }});
        
        return {
          success: false,
          error: "PDF build failed",
          results
        };
      }
    }
  • Tool schema definition: name, description, and input schema for parameters cwd (required), config, skipPreprocess.
    {
      name: "review.build-pdf-hybrid",
      description: "JS→Ruby hybrid pipeline for PDF generation (PDF first priority)",
      inputSchema: {
        type: "object",
        properties: {
          cwd: { type: "string" },
          config: { type: "string" },
          skipPreprocess: { type: "boolean" }
        },
        required: ["cwd"]
      }
    },
  • Handler case in the main CallToolRequestHandler switch that delegates to hybridCommands.buildPdfHybrid and returns the result.
    case "review.build-pdf-hybrid": {
      const result = await hybridCommands.buildPdfHybrid({
        cwd: args.cwd as string,
        config: args.config as string | undefined,
        skipPreprocess: args.skipPreprocess as boolean | undefined
      });
      return {
        content: [
          { type: "text", text: JSON.stringify(result) }
        ]
      };
    }
  • Registration of hybridCommands object exporting the buildPdfHybrid function for use in index.ts.
    export const hybridCommands = {
      preprocess: preprocessCommand,
      buildPdfHybrid: buildPdfHybridCommand,
      checkRubyExtensions: checkRubyExtensionsCommand,
      testMapfile: testMapfileCommand
  • TypeScript interface defining the input options for the buildPdfHybridCommand handler.
    export interface BuildPdfOptions {
      config?: string;
      skipPreprocess?: boolean;
      cwd: string;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'PDF generation' and a 'hybrid pipeline', but fails to describe key traits such as whether this is a read-only or mutating operation, what permissions or authentication might be needed, potential side effects (e.g., file creation), rate limits, or error handling. This leaves significant gaps in understanding the tool's behavior.

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 brief and to the point, using a single sentence that efficiently conveys the core idea. However, the phrase 'PDF first priority' is somewhat ambiguous and could be more precise, slightly reducing its effectiveness. Overall, it avoids unnecessary verbosity.

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?

Given the complexity implied by a 'hybrid pipeline' with 3 parameters, no annotations, and no output schema, the description is insufficient. It does not cover behavioral aspects, parameter meanings, or expected outputs, making it incomplete for effective tool selection and invocation. The lack of sibling differentiation further exacerbates this gap.

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?

Schema description coverage is 0%, so the description must compensate for the lack of parameter documentation. It does not explain any of the three parameters (cwd, config, skipPreprocess), their purposes, formats, or how they influence the PDF generation process. This results in poor parameter semantics, as users must guess based on the schema alone.

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 the tool is for 'PDF generation' with a 'JS→Ruby hybrid pipeline', which provides a general purpose. However, it lacks specificity about what exactly is generated (e.g., from what source, for what content) and does not clearly distinguish it from sibling tools like 'review.preprocess' or 'review.test-mapfile', which might also involve processing steps. The phrase 'PDF first priority' is vague and adds little clarity.

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 explicit guidance is provided on when to use this tool versus alternatives. The description mentions a 'hybrid pipeline' but does not specify scenarios, prerequisites, or exclusions. Sibling tools like 'review.preprocess' or 'review.lint' might be related, but no comparison or context is given, leaving usage unclear.

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