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.

 

 

 

Book a meeting to get started!

We offer a one-hour introduction meeting about our AI Assistant for Optimizely CMS 12. (Swedish or English)

Take me to booking page

The AI Assistant: This is what you get

Feature-Rich for Enhanced Editorial Efficiency

Epicweb's AI Assistant comes with an impressive array of features:

  1. Text Suggestions and Alternatives: Enhance your writing with AI-generated phrasing and alternative variations.

  2. Multilingual Translation: Seamlessly translate your text into multiple languages while preserving formatting and style to reach a diverse audience.

  3. SEO, AEO and GEO: Generate optimization content for search engines and AI search.

  4. Prompt Pro Assistance: It saves time and helps you get more out of your ideas, instantly.

  5. Image AltText Analyzer: Advanced AI capabilities to analyze images and automatically populate media object properties

  6. Image Generation: Create relevant and engaging images that complement your content.

  7. Image Transformer: Take any image, enhance it, and add new elements with AI-powered creativity. Transform the way you interact with images.

  8. New Text Generation: Generate fresh content that keeps your audience engaged.

  9. Text Summarization: Quickly condense long texts into concise summaries, saving time and maintaining essence, perfect for SEO descriptions.

  10. HTML Formatting: The AI-Assistant offers a range of formatting capabilities within the Rich Text Editor. WCAG Compatible.

  11. Spell-Checking: Ensure your content is error-free and professionally polished.

  12. Tone Adjustment and Consistency: Adapt your content’s tone to suit its purpose and maintain a consistent brand voice.

  13. Keyword Extraction: Identify and extract key terms from your text for SEO optimization.

  14. Custom Prompts with ChatGPT: Leverage the power of ChatGPT to run your own prompts for unique content creation.

  15. Custom Shortcut Prompts: Add your own shortcuts for frequently used commands, connect tools and enhancing productivity.

  16. Inline ChatGPT Help: Use ChatGPT or Google GEMINI directly within the platform for instant assistance.

  17. Tools for AI: Connect your C# Function Calling or MCP tools directly to the AI Assistant, enabling custom integrations.

  18. RAG (Retrieval-Augmented Generation): Connect your own knowledge base for AI responses powered by your organization’s internal data.

Streamlined Integration into Optimizely

The AI Assistant is seamlessly integrated into every field within the Optimizely CMS and Commerce platform, ensuring that these powerful features are accessible right where you need them, in the editor mode.

Getting Started with The Epicweb AI-Assistant:

To get started with the free evaluation, simply fill in the form in our website to get started and download the addon to your Optimizely CMS and Customizable Commerce platform from the Optimizely Nuget feed.

Follow our beginner-friendly guide or dive deep with our comprehensive documentation.

Installation is quick and easy, allowing you to start harnessing the power of AI assistance in no time.

Book a meeting to get started!

We offer a one-hour introduction meeting about our AI Assistant for Optimizely CMS 12. (Swedish or English)

Take me to booking page

Note: This blog post has been enhanced with the help of the AI-Assistant for Optimizely.

How does it work?

About the Author

Luc Gosso

OMVP Luc Gosso

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