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.
b) The second option is the MCP HTTP Requests
tool by godzeo 2.
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:
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.
Your automation page will open, where you need to fill in your System Prompt and Trigger Message.
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 🚨"
}
}
}
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>.
`
Your setup should look like this (be sure to use the correct MCP Servers with the "@" sign):
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.
You can also click on the Chat session Id below to see how the model interacted with the system prompt and trigger.
Use Cases of the Automation
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Behind the Scenes Working
When you click Trigger Automation in Glama, here’s the exact journey the information takes behind the scenes:
- 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).
The AI Takes the First Step
The AI reads the Trigger Message and decides its first move: it tells theHTTP_Tool
to perform a GET request on the TechCrunch RSS feed.Fetching the Data
TheHTTP_Tool
connects to the TechCrunch website, downloads the raw XML news feed, and passes that data back to the AI.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).
-
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.
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.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.
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.
Top comments (0)