DEV Community

Cover image for Create Custom Post Captions with Glama AI Automation feature: A Step-by-Step Tutorial
Om Shree
Om Shree

Posted on • Originally published at glama.ai

Create Custom Post Captions with Glama AI Automation feature: A Step-by-Step Tutorial

In digital marketing and content creation, it’s important to be fast and relevant. Social media platforms like LinkedIn, X (formerly Twitter), and Instagram each have their own style and audience, so using the same caption everywhere doesn’t work well. Because of this, creators and marketers spend a lot of time writing captions for each platform. This takes effort and may miss current trends that help increase engagement.

AI automation can help. By using advanced language models, content can be created quickly and stay up-to-date with trends. This article shows how the Model Context Protocol (MCP) can be used to build such automated systems. We’ll explain how Glama, an AI tool with strong MCP support, can generate platform-specific captions and send them directly to your Telegram for easy use. This guide will help developers and researchers set up and use these tools to make content creation simpler and faster.

Step-by-Step Tutorial: Generating Captions with Glama

1. Finding the Right MCP Server

a) The first option is the mcp-server-requests tool by coucya 1.
MCP Server Requests

b) The second option is the MCP HTTP Requests tool by godzeo 2.
MCP HTTP Requests

Click on Deploy Server. A dialog box will appear. Don’t worry, just click Deploy.
Your MCP Servers page should now look like this 3:
MCP Servers Page

2. Navigating to the Automations Tab

Go to your Automations tab on your Glama window 4.

Click on New Automation and give it a title.
New Automation

Your automation page will open, where you need to fill in your System Prompt and Trigger Message.
Automation Setup

3. Setting Up Your Telegram Bot

To receive the generated captions, you need to set up your Telegram bot. For detailed instructions, refer to the official Telegram documentation 5 and this step-by-step guide 6.

4. Configuring Your Automation

Return to your automation window.

4.1 System Prompt

Copy and paste the following System Prompt:

You are a professional social media expert. Your goal is to find a trending topic and create content.

IMPORTANT CONTEXT:
Find the content inside the very first <description> tag you see. This will be the news topic.

Based on that single news topic, write three distinct social media posts:

1. **Twitter:** A short, punchy tweet under 280 characters with 2–3 relevant hashtags.
2. **LinkedIn:** A professional, insightful post discussing the topic's business implications.
3. **Instagram:** An engaging caption with emojis and a list of 5 trending hashtags.

Finally, you MUST send this complete generated text to the user by calling the `http_post` tool.

Use these exact details for the tool call:
- **name** → "http_post"
- Inside **arguments**, include two fields:
  1. "url" → "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage"
  2. "json" → an object with:
     - "chat_id": <YOUR_CHAT_ID>
     - "text": "<your generated content here>"

The final tool call must look exactly like this structure (with your generated text replacing <your generated content here>):

```

json
{
  "name": "http_post",
  "arguments": {
    "url": "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage",
    "json": {
      "chat_id": <YOUR_CHAT_ID>,
      "text": "🚨 generated posts here 🚨"
    }
  }
}


Enter fullscreen mode Exit fullscreen mode

4.2 Trigger Message

And paste the following Trigger Message:


text
Use @mcp-server-requests tool to make a GET request to the URL https://techcrunch.com/feed/, use @MCP HTTP Requests to parse raw XML data.

Take the content from the very first <description> tag, generate the three social media posts as per the system prompt, and send the result to my Telegram bot at https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage with chat_id <YOUR_CHAT_ID>.


Enter fullscreen mode Exit fullscreen mode


`

Your setup should look like this (be sure to use the correct MCP Servers with the "@" sign):

Complete Automation Setup

Now click on Save and then Trigger Automation.

And DONE!!! Your automation is complete. You can now open your Telegram to see the desired caption generated by your very own MCP server automation feature.

Automation Result

You can also click on the Chat session Id below to see how the model interacted with the system prompt and trigger.

Chat Session

Use Cases of the Automation

  1. Daily News Updates
  • Automatically fetch the latest articles from TechCrunch (or any RSS feed) and send formatted posts directly to Telegram.
  • Saves time for teams who want quick, ready-to-publish social content.
  1. Company Announcements
  • Connect the system to a company blog or news feed.
  • Every time a new article is published, the automation pushes polished social posts straight to the marketing team’s Telegram channel.
  1. Content Curation for Social Media Managers
  • Social media managers can get ready-to-use Twitter, LinkedIn, and Instagram captions without manually writing them.
  • Cuts down repetitive work and ensures consistent formatting.
  1. Internal Alerts
  • Instead of social media posts, the same pipeline can be used for status updates, product launches, or even error reports.
  • Telegram becomes a central, reliable notification hub.
  1. Multi-Platform Posting
  • Since the AI is instructed to create different formats, one automation can prepare content tailored for multiple platforms in one go.
  • Ensures brand messaging stays uniform across channels.
  1. Rapid Prototyping for Marketing Campaigns
  • Marketers can test different tones and formats quickly, just by changing the System Prompt.
  • Makes it easy to experiment without having to rebuild the workflow.

Use Cases

Behind the Scenes Working

When you click Trigger Automation in Glama, here’s the exact journey the information takes behind the scenes:

  1. The Trigger is Sent Glama sends two things to the AI:
  • The Trigger Message (a one-time instruction that tells the AI how to start, in this case: fetch the TechCrunch feed).
  • The System Prompt (a permanent briefing that defines the AI’s role, how to process the data, and how to deliver the results).
  1. The AI Takes the First Step
    The AI reads the Trigger Message and decides its first move: it tells the HTTP_Tool to perform a GET request on the TechCrunch RSS feed.

  2. Fetching the Data
    The HTTP_Tool connects to the TechCrunch website, downloads the raw XML news feed, and passes that data back to the AI.

  3. The AI Processes the Data
    With the XML feed in hand, the AI goes back to its System Prompt. Following those instructions, it:

  • Reads the feed and pulls out the first news description.
  • Writes three creative and formatted social media posts (one each for Twitter, LinkedIn, and Instagram).
  1. The AI Prepares Delivery Once the posts are ready, the AI issues a second command: this time it tells the HTTP_Tool to perform a POST request to Telegram’s servers. It includes:
  • The Bot Token (the secure password proving it has permission).
  • The Chat ID (the unique address of the user to send the message to).
  • The actual social media posts as the message content.
  1. Telegram Delivers the Message
    Telegram’s servers receive the POST request, check the Bot Token and Chat ID, and if everything matches, the message is pushed directly into your Telegram app.

  2. Confirmation Comes Back
    Finally, Telegram replies with a simple confirmation ({"ok": true}), which shows up in the Glama logs as proof that the whole chain worked successfully.

Behind the Scenes

Conclusion

Glama’s AI Automation 7, using the Model Context Protocol (MCP), makes creating social media captions easier and faster. Instead of doing the same work again and again, it helps automate the process in a smart way. Glama’s agents can pull in live information, format it properly, and connect with other tools. Since MCP is open and flexible, it can adapt when new platforms or tools are added. This helps developers and researchers build systems that work on their own, handle new tasks, and solve problems without much help from people.

References / Tools


  1. MCP Server Requests 

  2. MCP HTTP Requests 

  3. MCP Servers Page 

  4. Automation Window 

  5. Telegram bot documentation 

  6. How to Create a Telegram Bot With No Coding? 

  7. Glama AI Gateway Documentation 

Top comments (0)