Skip to main content
Glama

repurpose_content

Adapt content from one social platform to another by automatically adjusting character limits, hashtag styles, and formatting requirements.

Instructions

Take content from one platform and adapt it for another. Handles character limits (X: 280, LinkedIn: 3000, Instagram: 2200), hashtag styles, and format differences automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
original_textYesThe original post content
source_platformYesOriginal platform
target_platformYesTarget platform

Implementation Reference

  • The core logic for repurposing content is implemented in the repurposeContent function.
    function repurposeContent(text: string, sourcePlatform: PlatformType, targetPlatform: PlatformType): string {
      const targetLimits = PLATFORM_LIMITS[targetPlatform];
      const hashtags = selectHashtags(targetPlatform, targetPlatform === "instagram" ? 5 : 3);
    
      // Strip existing hashtags
      let cleaned = text.replace(/#\w+/g, "").trim();
      // Remove trailing dots (Instagram spacer)
      cleaned = cleaned.replace(/\n\.\n\.\n\.\n?/g, "\n").trim();
    
      let result: string;
    
      if (targetPlatform === "x") {
        // X/Twitter: ultra-concis, prendre le hook + CTA
        const lines = cleaned.split("\n").filter((l) => l.trim().length > 0);
        const hook = lines[0] || "";
        // Find a line that looks like a CTA
        const ctaLine = lines.find((l) =>
          l.includes("?") || l.toLowerCase().includes("stresszeroentrepreneur") || l.toLowerCase().includes("rdv"),
        );
    
        result = hook;
  • src/index.ts:798-813 (registration)
    The 'repurpose_content' tool is registered with the MCP server using server.registerTool, defining the input schema and the handler that calls repurposeContent.
    server.registerTool(
      "repurpose_content",
      {
        title: "Repurpose Content for Another Platform",
        description:
          "Take content from one platform and adapt it for another. " +
          "Handles character limits (X: 280, LinkedIn: 3000, Instagram: 2200), " +
          "hashtag styles, and format differences automatically.",
        inputSchema: {
          original_text: z.string().describe("The original post content"),
          source_platform: z.enum(["linkedin", "instagram", "x", "tiktok"]).describe("Original platform"),
          target_platform: z.enum(["linkedin", "instagram", "x", "tiktok"]).describe("Target platform"),
        },
        annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false },
      },
      async ({ original_text, source_platform, target_platform }) => {

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gomessoaresemmanuel-cpu/content-distribution-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server