Blog

All Blog Posts  |  Next Post  |  Previous Post

Supercharging Delphi Apps with TMS AI Studio v1.2 Toolsets: Fine-Grained AI Function Control

Today

TMS Software Delphi  Components tmsaistudio

Artificial Intelligence is no longer a futuristic concept—it’s a present-day differentiator. Businesses are racing to embed AI capabilities into their applications, and developers who miss this wave risk falling behind. For Delphi VCL and FMX developers, TMS AI Studio is the bridge to seamlessly integrate cutting-edge LLMs such as OpenAI, Gemini, Grok, Mistral, Perplexity, Claude, Ollama, DeepSeek, and more.

At the heart of this integration lies the new toolset mechanism of the TTMSMCPCloudAI component now available in TMS AI Studio v1.2. This powerful design lets you expose fine-grained, predefined functions to the AI in a controlled and efficient way. With toolsets, you can teach the LLM how to interact with your application while keeping the communication lightweight, relevant, and future-proof. Think of a toolset as a native MCP server built-in in your application.


Why Toolsets Matter

When you expose functions to an LLM, you are essentially giving it a vocabulary of “actions” it can take. The toolset defines these actions. A bloated set of tools will slow down interactions and burden the AI with unnecessary complexity. The key is to keep toolsets focused, minimal, and purposeful—allowing the LLM to be effective without being overwhelmed.

Each toolset TTMSMCPCloudAIToolSet in TMS AI Studio is tied to the TTMSMCPCloudAI component:

MyToolSet.AI := TTMSMCPCloudAI;

And if you want to go beyond what’s provided out-of-the-box, you can easily create your own toolset by descending from TTMSFNCCloudAIToolSet and override the virtual method DefineTools where you add the tools you want to bundle.

TMyToolSet = class(TTMSFNCCloudAIToolSet) protected procedure DefineTools; override; end; procedure TMyToolSet.DefineTools; var tool: TTMSFNCCloudAITool; param: TTMSFNCCloudAIParameter; begin BeginUpdate; tool := Tools.Add; tool.Name := 'MyFirstProc'; tool.Description := 'this is the description that should make the LLM aware of what the tool is used for'; param := tool.Parameters.Add; param.Name := 'FirstParam"; param.Description := 'describe here what the first parameter is used for'; EndUpdate; end;

Predefined Toolsets in TMS AI Studio

TMS AI Studio already comes with several ready-to-use toolsets that cover common scenarios. Let’s look at them in detail, along with real-world use cases.


1. Logging with TTMSFNCCloudAILogger

The logging toolset gives the AI controlled access to output messages—whether to the console, a message box, or a log file.

Available tools:

  • MessageShow – Show a message dialog.

  • ConsoleShow – Write output to the console.

  • LogToFile – Append text to a log file.

Use cases:

  • Letting the AI provide progress updates during a long-running task.

  • Capturing LLM reasoning for debugging.

  • Building an AI-powered assistant that keeps a trace of its conversations in a file.

Example:

var Logger: TTMSFNCCloudAILogger; begin Logger := TTMSFNCCloudAILogger.Create(Self); Logger.AI := TMSMCPCloudAI1; Logger.LogFileName := 'aibot.log'; end;

2. File System Access with TTMSFNCCloudAIFileSystem

This toolset lets the AI interact with the local file system in a structured, restricted manner.

Available tools:

  • DoGetFiles, DoGetFolders – Enumerate files and directories.

  • DoGetTextFile, DoWriteTextFile, DoAppendTextFile – Read, create, or update text files.

  • DoCreateFolder, DoCopyFile, DoMoveFile – Manage files and folders.

Use cases:

  • Letting the AI organize project files on disk.

  • AI-powered document editors that read/write local notes.

  • Automation of repetitive file management tasks through natural language prompts.

Example Prompt to the AI:
“Find all .log files in the logs folder and summarize their contents.”


3. Data Handling with TTMSFNCCloudAIDataSet

This toolset exposes Delphi’s TDataSet functionality to the AI—allowing it to query and manipulate database records.

Available tools:

  • DoGetFields, DoGetTableName – Inspect schema.

  • DoNext, DoPrevious, DoFirst, DoLast, DoMove – Navigate records.

  • DoGetRecords, DoGetRecord – Fetch data.

  • DoAddRecord, DoModifyRecord, DoLocateRecord – Manipulate records.

Use cases:

  • Natural-language querying of datasets (e.g., “Show me all customers from Germany”).

  • AI-driven data exploration tools in Delphi apps.

  • Automating record updates via conversational input.

Example:
Imagine a CRM system where a user asks the AI:
“Find the most recent 10 orders for customer John Smith and update the delivery status to ‘Shipped’.”
The AI can do this using the exposed dataset tools.


4. Email Integration with TTMSFNCCloudAIEmail

This toolset gives the AI controlled access to sending and retrieving emails via POP3/SMTP.

Available tools:

  • DoSendEmail – Send email.

  • DoGetCountEmail – Check inbox message count.

  • DoRetrieveEmail – Retrieve emails.

Use cases:

  • An AI-powered assistant that can draft and send reports directly from Delphi applications.

  • Smart inbox triage: “Summarize today’s new emails from clients and mark urgent ones.”

  • Automated email responses with human approval.

Example:

var EmailTools: TTMSFNCCloudAIEmail; begin EmailTools := TTMSFNCCloudAIEmail.Create(Self); EmailTools.AI := TMSMCPCloudAI1; EmailTools.SMTPHost := 'smtp.mailserver.com'; EmailTools.SMPTUserName := 'noreply@myapp.com'; EmailTools.SMTPPassword := 'mypassword'; EmailTools.SMTPSendFrom := 'noreply@myapp.com'; end;

Now, the AI can send status updates directly to stakeholders.


The Future-Proof Advantage of TMS AI Studio

The true strength of TMS AI Studio is abstraction. Instead of binding your Delphi app to one vendor’s LLM, you can switch between OpenAI, Gemini, Claude, Mistral, or even run local models with Ollama—without rewriting your integration. Your investment stays future proof, regardless of where the AI landscape shifts.

And by carefully curating toolsets, you ensure that the LLM works with just the right amount of control: not too much, not too little.


Conclusion: Don’t Miss the AI Wave

The competitive edge of applications increasingly depends on their AI capabilities. Native Delphi VCL & FMX developers can no longer afford to ignore this shift. With TMS AI Studio and its powerful toolset system, you can:

  • Give LLMs fine-grained but lightweight control over your application.

  • Leverage ready-to-use toolsets for logging, file systems, datasets, and email.

  • Expand with your own toolsets tailored to your business needs.

  • Stay future proof with seamless multi-LLM integration.

👉 If you haven’t started embedding AI into your Delphi apps yet, now is the time. The tools are here. The use cases are endless. And the risk of being left behind is real.



Bruno Fierens




This blog post has not received any comments yet.



Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post