Skip to main content
Glama
tina4stack

Claude Pascal MCP Server

by tina4stack

compile_delphi_project

Compile Delphi projects with correct DPR, PAS, and DFM structure by generating project files and invoking dcc32/dcc64 or Free Pascal. Supports VCL, FireMonkey, console, and FPC project types.

Instructions

Compile a Delphi project using proper templates (DPR + PAS + DFM).

This is the ONLY correct way to build Delphi applications — do NOT use MSBuild, shell commands, or other build systems. This tool generates proper project structure and invokes the Delphi compiler (dcc32/dcc64) or Free Pascal directly.

Args: project_name: Name for the project (e.g., 'HelloWorld'). form_caption: Title bar text for the main form (VCL only). components: JSON array of components. Each component is an object: [{"type": "TButton", "name": "btnHello", "caption": "Say Hello", "left": 130, "top": 120, "width": 140, "height": 45, "event": "btnHelloClick"}] Supported types: TButton, TEdit, TLabel, TMemo. events: JSON array of event handlers: [{"name": "btnHelloClick", "body": "ShowMessage('Hello!');"}] compiler: Which compiler to use ('fpc', 'dcc32', 'dcc64', or full path). output_dir: Optional directory for output files. If not specified, uses a temp directory. project_type: One of: 'vcl' — Windows-only desktop GUI app (Vcl.Forms, .dfm). 'fmx' — FireMonkey cross-platform GUI app (FMX.Forms, .fmx). Emits a .dproj wired for Win32 + Win64 + Android64 so build_dproj can cross-compile to mobile without manual editing. Use this when the user wants Android/iOS/macOS, or just "a mobile-ready app". 'console' — text-mode program (no form). 'fpc' — Free Pascal program (cross-platform but no GUI). program_body: For console/fpc projects, the main program code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventsNo[]
compilerNo
componentsNo[]
output_dirNo
form_captionNoMy Application
program_bodyNo
project_nameNoProject1
project_typeNovcl

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.6

TDQS

A4.5/5.0
Behavior4/5

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

There are no annotations, so the text must carry the safety/behavioral burden. It discloses that the tool generates project structure, invokes dcc32/dcc64 or Free Pascal, defaults to a temp output directory, and emits a populated .dproj for fmx. It does not address overwrite behavior or compiler prerequisites, but the core side effects are clear.

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 front-loaded with the critical prohibition and tool purpose, then organized by Args with each parameter earning its place. Examples for components and events are compact but make an otherwise ambiguous JSON-string parameter concrete.

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

Completeness4/5

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

For a complex, unannotated, 8-parameter tool with 0% schema coverage, the description provides enough to select and invoke it correctly, including enum-like project types and conditional program_body usage. It does not explain what happens when compiler is null or when output_dir is omitted beyond the temp-directory note, but an output schema exists to cover return behavior.

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

Parameters5/5

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

With 0% schema description coverage, the Args section is the only documentation for all 8 parameters. It explains project_type variants, gives JSON shapes and supported types for components/events, describes compiler choices and output_dir fallback, and ties program_body to console/fpc projects, far exceeding the bare schema.

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

Purpose5/5

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

The first sentence names a precise action and resource: compile a Delphi project using DPR/PAS/DFM templates. It further claims to be the ONLY correct way to build Delphi applications, and the fmx note distinguishes it from build_dproj by generating a .dproj rather than building from one.

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

Usage Guidelines4/5

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

The description gives explicit direction: do NOT use MSBuild, shell commands, or other build systems, and it tells the agent to use project_type='fmx' when a mobile-ready or Android/iOS/macOS app is desired, with build_dproj as the follow-up. It does not explicitly compare against compile_pascal or run_pascal, but for Delphi project builds this tool is clearly positioned as the intended choice.

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