Building Smarter Optimizely Solutions with AI Tools, MCP, and Function Calling

You can now integrate AI Tools, Model Context Protocol (MCP), and function calling with Optimizely CMS, allowing editors to engage with actual, connected business logic directly within the CMS interface. This enhancement means your AI Assistant is no longer restricted to static responses. It can access real-time data, activate real functions, and provide intelligent responses based on your logic, APIs, and systems, without editors needing to leave the Optimizely workspace.

icon of user profile
By OMVP Luc Gosso

What Are Tools?

Tools are connected functions that extend what the AI-Assistant can do.
They act as bridges between the AI and your real-time data or business logic, allowing the assistant to go beyond static content and interact directly with your systems.

In simple terms, Tools are powered by function calling. You can easily connect them to your existing C# methods, giving the AI the ability to call your code when it needs specific information or to perform an action.

A screenshot of a user interface showing an AI assistant tool for optimizing content with functionality details.

For instance, you may integrate functions that retrieve product details, access documentation, acquire data from external systems, or extract analytics from an API. The AI dynamically utilizes these functions, combining its language comprehension with your actual data sources.


How Editors Use Tools in Practice

Inside the Optimizely CMS editor view, the workflow remains intuitive and natural.
When an editor writes a question to the AI-Assistant, they can type the @ symbol to bring up a list of all available Tools (this step is optional — it can also be automated if you want the AI to choose the right Tool itself).

As soon as “@” is entered, the assistant displays all connected functions, along with short descriptions of what each Tool does.

A user interface displaying several functions related to content management and SEO tasks.

The editor can then simply select one — for example:

“Summarize in 20 words product T8877 @GetProductDescription”

The AI will automatically use that specific Tool to retrieve the live product data and generate a tailored answer. The entire process happens in real time, powered by your system’s actual logic.

DisableTools is possible

The command @DisableTools allows you to disable tools for a particular request.

A user interface showing a prompt for generating a currency table with tools disabled options. Text is visible.


Why This Matters

This combination of AI and function calling transforms the Optimizely CMS experience.
Editors no longer have to switch between systems, copy-paste content, or wait for technical help to extract data. They can simply ask — and the assistant handles the rest, securely and instantly.

From a developer’s perspective, Tools are straightforward to integrate.
You can expose any existing logic as a Tool via a C# function, giving you full control over what the AI can access. The implementation respects your architecture, security policies, and permissions.

The result is an intelligent assistant that can perform real tasks, fetch live data, and deliver accurate, up-to-date information directly within your Optimizely ecosystem.


Installation and Configuration

Setting up Tools within the Epicweb AI-Assistant inside Optimizely is designed to be as flexible as possible.
Developers can register their own functions and register them thru startup.cs

Download the built in tools, download nuget package Epicweb.Optimizely.AIAssistant.Tools

Register the tools =>

  services
     .AddAIAssistant()
     // Register MCP tool types
     .RegisterMcpToolType(typeof(BuiltinTools))

     using Epicweb.Optimizely.AIAssistant.Tools;

Tools is available from version 2.0 of Epicweb AI Assistant

 

Built-in Tools Overview

The assistant comes with several default tools that let AI retrieve and work with content directly from Optimizely CMS:

  • GetContentById – fetch content (or a specific property, e.g. MainBody, Preamble, SEO title) by content ID.
  • GetThisContent – fetch all properties of the current page or block (used for tasks like “summarize this page” or “create an SEO title”).
  • GetChildContent – fetch children of a page or block (useful for “list all child titles” or “summarize child pages”).
  • GetContentByName – search content by name or partial match across all page types.

👉 In short: these tools allow the AI to look up content and structure from the CMS, so it can summarize, generate SEO metadata, build lists, or answer context-aware editorial queries.

How to implement your Custom Tools

Example tool, fetch product data from Optimizely Commerce

using Epicweb.Optimizely.AIAssistant.Models;
using ModelContextProtocol.Server; // or using Epicweb.Optimizely.AIAssistant.Attributes;
using System.ComponentModel;

[McpServerToolType]
public static class ProductInfoTools
{
    [McpServerTool(Name = "GetProductDescription"),
 Description("Get detailed product information based on product number")]
    public static async Task<ProductInfo> GetProductDescriptionAsync(
        [Description("The product number to get information for, e.g. 'P12345', 'B78901'")] string productNumber,
        RequestModel context = null)//the context parameter is optional, it can be used to get more information about the current request, like current page, language or property
    {
        // implement your logic to fetch product details here

        return new ProductInfo
        {
            ...
        };
    }
    // Product information POCO class
    public class ProductInfo
    {
        public string ProductNumber { get; set; } = string.Empty;
        public string Name { get; set; } = string.Empty;
        public string Description { get; set; } = string.Empty;
        public decimal Price { get; set; }
        public bool InStock { get; set; }
        public string Category { get; set; } = string.Empty;
        public Dictionary<string, string> Specifications { get; set; } = new Dictionary<string, string>();
    }
}     

Now register the tools in startup:

  services
     .AddAIAssistant()    
     // Register MCP tool types
     .RegisterMcpToolType(typeof(ProductInfoTools))

Now you can use prompts like "Create a sales pitch of Product P-5555 and link to the product" or "Create a table of the differences between products BS8877 and L8877"

 

Using MCP ModelContextProtocol

The MCP ModelContextProtocol is a framework that facilitates communication and data exchange in distributed systems. It acts as a protocol layer allowing seamless interoperability between services and components in a .NET environment. By leveraging MCP tools, developers can efficiently utilize the ModelContextProtocol to establish connections, synchronize data, and manage interactions across varied system architectures. It simplifies complex network communication tasks, making it possible to build robust and scalable solutions. With a .NET library that includes MCP tools, developers can easily integrate this protocol into their projects by using "RegisterMcpToolType" at startup.

 

 

 

Boka ett möte för att komma igång!

Vi erbjuder ett timmes introduktionsmöte om vår AI-assistent för Optimizely CMS 12. (Svenska eller engelska)

Ta mig till bokningssidan

AI-assistenten: Det här får du

Funktionsrik för ökad redaktionell effektivitet

Epicwebs AI-assistent har en imponerande mängd funktioner:

  1. Textförslag och alternativ: Förbättra ditt skrivande med AI-genererade formuleringar och alternativa varianter.

  2. Flerspråkig översättning: Översätt din text sömlöst till flera språk samtidigt som formattering och stil bevaras för att nå en mångsidig publik.

  3. SEO, AEO och GEO: Generera optimeringsinnehåll för sökmotorer och AI-sökning.

  4. Prompt Pro Assistance: Det sparar tid och hjälper dig få mer ut av dina idéer, omedelbart.

  5. Bild AltText-analysator: Avancerade AI-funktioner för att analysera bilder och automatiskt fylla i medieobjektsegenskaper.

  6. Bildgenerering: Skapa relevanta och engagerande bilder som kompletterar ditt innehåll.

  7. Bildtransformer: Ta vilken bild som helst, förbättra den och lägg till nya element med AI-driven kreativitet. Förändra sättet du interagerar med bilder.

  8. Ny textgenerering: Generera nytt innehåll som håller din publik engagerad.

  9. Textsammanfattning: Snabbt kondensera långa texter till koncisa sammanfattningar, spara tid och behålla essensen, perfekt för SEO-beskrivningar.

  10. HTML-formatering: AI-assistenten erbjuder en rad formateringsmöjligheter inom Rich Text Editor. WCAG-kompatibel.

  11. Stavningskontroll: Säkerställ att ditt innehåll är fritt från fel och professionellt polerat.

  12. Tonaljustering och konsekvens: Anpassa din texts ton för att passa ändamålet och bibehålla en konsekvent varumärkesröst.

  13. Nyckelordsutvinning: Identifiera och extrahera nyckeltermer från din text för SEO-optimering.

  14. Anpassade uppmaningar med ChatGPT: Utnyttja kraften i ChatGPT för att köra egna uppmaningar för unik innehållsskapande.

  15. Anpassade genvägsuppmaningar: Lägg till egna genvägar för frekvent använda kommandon, koppla verktyg och öka produktiviteten.

  16. Inline ChatGPT-hjälp: Använd ChatGPT eller Google GEMINI direkt inom plattformen för omedelbar hjälp.

  17. Verktyg för AI: Anslut dina C# Funktionsanrop eller MCP-verktyg direkt till AI-assistenten, vilket möjliggör anpassade integrationer.

  18. RAG (Retrieval-Augmented Generation): Anslut din egen kunskapsbas för AI-svar som drivs av din organisations interna data.

Smidig integration i Optimizely

AI-assistenten är sömlöst integrerad i varje fält inom Optimizely CMS och Commerce-plattformen, vilket säkerställer att dessa kraftfulla funktioner är tillgängliga precis där du behöver dem, i redigerarläget.

Kom igång med Epicwebs AI-assistent:

För att komma igång med den kostnadsfria utvärderingen, fyll enkelt i formuläret på vår webbplats för att komma igång och ladda ner tillägget till din Optimizely CMS och anpassningsbara Commerce-plattform från Optimizely Nuget-feed.

Följ vår nybörjarvänliga guide eller dyka djupt med vår omfattande dokumentation.

Installation är snabb och enkel, vilket gör att du kan börja utnyttja kraften i AI-assistans på nolltid.

Boka ett möte för att komma igång!

Vi erbjuder ett timmes introduktionsmöte om vår AI-assistent för Optimizely CMS 12. (Svenska eller engelska)

Ta mig till bokningssidan

Notera: Detta blogginlägg har förbättrats med hjälp av AI-assistenten för Optimizely.

How does it work?

About the Author

Luc Gosso

OMVP Luc Gosso

– Independent Senior Web Developer
working with Azure, AI and Optimizely