Skip to main content
Glama
flydev-fr
by flydev-fr

lazarus.build

Compile Lazarus projects (.lpi) using lazbuild with configurable build modes, target CPU, and OS settings.

Instructions

Build a Lazarus (.lpi) project using lazbuild

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesPath to a Lazarus project file (.lpi)
buildModeNoLazarus build mode name (maps to --bm)
cpuNoTarget CPU for lazbuild (e.g. x86_64, i386, aarch64)
osNoTarget OS for lazbuild (e.g. win64, win32, linux)
lazbuildPathNoPath to lazbuild (defaults to "lazbuild")

Implementation Reference

  • Core handler function that validates the Lazarus project (.lpi), constructs lazbuild arguments, and executes the build command.
    async function lazarusBuild({ project, buildMode, cpu, os, lazbuildPath }: { project: string; buildMode?: string; cpu?: string; os?: string; lazbuildPath?: string; }) {
      const projPath = resolve(project);
      if (!existsSync(projPath)) {
        throw new Error(`Project not found: ${projPath}`);
      }
      if (!isLazarusProject(projPath)) {
        throw new Error('Unsupported project type. Provide a .lpi file');
      }
      const args: string[] = ['--build-mode='];
      if (buildMode) args[0] = `--build-mode=${buildMode}`; else args.pop();
      if (cpu) args.push(`--cpu=${cpu}`);
      if (os) args.push(`--os=${os}`);
      args.push('"' + projPath + '"');
      const lazbuild = lazbuildPath || 'lazbuild';
      return await runCommand(lazbuild, args, { cwd: dirname(projPath) });
    }
  • Input schema definition using Zod for validating parameters to the lazarus.build tool.
    const LazarusBuildInput = {
      project: z.string().describe('Path to a Lazarus project file (.lpi)'),
      buildMode: z.string().optional().describe('Lazarus build mode name (maps to --bm)'),
      cpu: z.string().optional().describe('Target CPU for lazbuild (e.g. x86_64, i386, aarch64)'),
      os: z.string().optional().describe('Target OS for lazbuild (e.g. win64, win32, linux)'),
      lazbuildPath: z.string().optional().describe('Path to lazbuild (defaults to "lazbuild")')
    };
  • src/server.ts:269-284 (registration)
    Registration of the 'lazarus.build' tool with MCP server, including description, schema, and thin wrapper handler that calls lazarusBuild and formats MCP response.
    mcpServer.registerTool('lazarus.build', {
      description: 'Build a Lazarus (.lpi) project using lazbuild',
      inputSchema: LazarusBuildInput,
    }, async (req: any) => {
      const { code, stdout, stderr } = await lazarusBuild(req);
      const ok = code === 0;
      return {
        content: [
          { type: 'text', text: ok ? `Lazarus build succeeded for ${basename(req.project)}` : `Lazarus build failed for ${basename(req.project)}` },
          { type: 'text', text: `Exit code: ${code}` },
          { type: 'text', text: '--- STDOUT ---\n' + stdout },
          { type: 'text', text: '--- STDERR ---\n' + stderr }
        ],
        isError: !ok
      };
    });
  • Helper function to check if a file is a Lazarus project file (.lpi), used in lazarusBuild validation.
    function isLazarusProject(file: string) {
      return extname(file).toLowerCase() === '.lpi';
    }

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

C2.9/5.0
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 states it 'builds' a project, implying a potentially resource-intensive operation, but doesn't mention execution time, side effects, error handling, or output format. This is inadequate for a tool with no annotation coverage.

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?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the essential information.

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 build tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'build' entails operationally, what happens on success/failure, or how to interpret results, leaving significant gaps in understanding the tool's behavior.

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?

The description adds no parameter information beyond what's already in the schema, which has 100% coverage. The baseline score of 3 is appropriate since the schema fully documents all parameters, though the description doesn't enhance understanding of their semantics or relationships.

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

Purpose4/5

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

The description clearly states the action ('Build') and the resource ('a Lazarus (.lpi) project using lazbuild'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'fpc.build' or 'delphi.build' beyond mentioning Lazarus specifically.

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?

The description provides no guidance on when to use this tool versus alternatives like 'fpc.build' or 'lazarus.clean'. It doesn't mention prerequisites, typical use cases, or exclusions, leaving the agent with no contextual usage information.

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

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/flydev-fr/mcp-delphi'

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