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

lazarus.clean

Clean Lazarus build artifacts to remove temporary files and reduce project size. Specify a Lazarus project file path to execute lazbuild --clean command.

Instructions

Clean Lazarus build artifacts using lazbuild --clean

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesPath to a Lazarus project file (.lpi)
lazbuildPathNoPath to lazbuild (defaults to "lazbuild")

Implementation Reference

  • The inline asynchronous handler function for the 'lazarus.clean' MCP tool. It calls the lazarusClean helper, processes the result, and returns a formatted MCP response with stdout/stderr and success status.
    }, async (req: any) => { const { code, stdout, stderr } = await lazarusClean(req); const ok = code === 0; return { content: [ { type: 'text', text: ok ? `Lazarus clean succeeded for ${basename(req.project)}` : `Lazarus clean 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 }; });
  • The main helper function implementing the clean logic by running 'lazbuild --clean' on the Lazarus project file (.lpi), with validation and proper working directory.
    async function lazarusClean({ project, lazbuildPath }: { project: 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[] = ['--clean', '"' + projPath + '"']; const lazbuild = lazbuildPath || 'lazbuild'; return await runCommand(lazbuild, args, { cwd: dirname(projPath) }); }
  • Zod-based input schema defining the parameters for the lazarus.clean tool: required project path and optional lazbuild path.
    const LazarusCleanInput = { project: z.string().describe('Path to a Lazarus project file (.lpi)'), lazbuildPath: z.string().optional().describe('Path to lazbuild (defaults to "lazbuild")') };
  • src/server.ts:286-289 (registration)
    The mcpServer.registerTool call that registers the 'lazarus.clean' tool with its description, input schema, and handler function.
    mcpServer.registerTool('lazarus.clean', { description: 'Clean Lazarus build artifacts using lazbuild --clean', inputSchema: LazarusCleanInput, }, async (req: any) => {

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