Skip to main content
Glama

markitup_generate

Analyzes images with Claude to write marketing copy, then renders visual variations using Gemini. Choose a template to get polished marketing visuals.

Instructions

Generate polished marketing-visual variations of a screenshot or image using the MarkItUp pipeline (Claude analyzes the image and writes copy; Gemini renders the visuals). Costs 1 credit. Provide the image either as a public URL (image_url) OR as a base64-encoded string (image_base64) — exactly one. Common template IDs: glassmorphic, clean_minimal, bold_marketing, dark_professional, documentation. Returns the generated images plus the marketing copy (headline, subhead) written by Claude.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_urlNoPublic HTTPS URL of the source image. Mutually exclusive with image_base64.
image_base64NoBase64-encoded image bytes (no data: prefix). Mutually exclusive with image_url.
image_mime_typeNoMIME type when supplying image_base64. Defaults to image/png.image/png
descriptionYesNatural-language description of what the image shows and what should be highlighted or emphasized.
template_idYesTemplate ID controlling visual style. Standard options: glassmorphic, clean_minimal, bold_marketing, dark_professional, documentation.
aspect_ratioNoOptional. One of: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.
image_sizeNoOptional output resolution tier. Defaults to backend choice.

Implementation Reference

  • The runGenerate function is the actual handler that executes the markitup_generate tool logic. It extracts parameters, validates inputs, calls the API via api.post('/generate', ...), and returns generated images plus marketing copy.
    export async function runGenerate(
      api: MarkItUpApiClient,
      args: Record<string, unknown>
    ): Promise<{
      content: Array<TextContent | ImageContent>;
      structuredContent: GenerateBackendResponse;
    }> {
      const imageUrl = typeof args.image_url === "string" ? args.image_url : undefined;
      const imageBase64 = typeof args.image_base64 === "string" ? args.image_base64 : undefined;
      const mimeType = typeof args.image_mime_type === "string" ? args.image_mime_type : "image/png";
      const description = typeof args.description === "string" ? args.description : "";
      const templateId = typeof args.template_id === "string" ? args.template_id : "";
      const aspectRatio = typeof args.aspect_ratio === "string" ? args.aspect_ratio : undefined;
      const imageSize = typeof args.image_size === "string" ? args.image_size : undefined;
    
      if (!description || !templateId) {
        throw new Error("description and template_id are required");
      }
      if (!!imageUrl === !!imageBase64) {
        throw new Error("Provide exactly one of image_url or image_base64");
      }
    
      const imageDataUrl = imageUrl
        ? await fetchAsDataUrl(imageUrl)
        : `data:${mimeType};base64,${imageBase64}`;
    
      const body: Record<string, unknown> = {
        imageDataUrl,
        description,
        templateId,
      };
      if (aspectRatio) body.aspectRatio = aspectRatio;
      if (imageSize) body.imageSize = imageSize;
    
      const data = await api.post<GenerateBackendResponse>("/generate", body);
    
      const content: Array<TextContent | ImageContent> = [];
      const headline = data.text?.headline;
      const sub = data.text?.subHeadline;
      if (headline || sub) {
        content.push({
          type: "text",
          text: [
            headline ? `Headline: ${headline}` : null,
            sub ? `Sub-headline: ${sub}` : null,
          ]
            .filter(Boolean)
            .join("\n"),
        });
      } else {
        content.push({ type: "text", text: "Generated 3 variations." });
      }
    
      for (const variation of data.variations) {
        const parsed = parseDataUrl(variation);
        if (parsed) {
          content.push({
            type: "image",
            data: parsed.data,
            mimeType: parsed.mimeType,
          });
        }
      }
    
      return { content, structuredContent: data };
    }
  • The generateTool object defines the tool's name ('markitup_generate'), description, and inputSchema with properties (image_url, image_base64, image_mime_type, description, template_id, aspect_ratio, image_size).
    export const generateTool = {
      name: "markitup_generate",
      description:
        "Generate polished marketing-visual variations of a screenshot or image using the MarkItUp pipeline " +
        "(Claude analyzes the image and writes copy; Gemini renders the visuals). " +
        "Costs 1 credit. " +
        "Provide the image either as a public URL (image_url) OR as a base64-encoded string (image_base64) — exactly one. " +
        "Common template IDs: glassmorphic, clean_minimal, bold_marketing, dark_professional, documentation. " +
        "Returns the generated images plus the marketing copy (headline, subhead) written by Claude.",
      inputSchema: {
        type: "object",
        properties: {
          image_url: {
            type: "string",
            description:
              "Public HTTPS URL of the source image. Mutually exclusive with image_base64.",
          },
          image_base64: {
            type: "string",
            description:
              "Base64-encoded image bytes (no data: prefix). Mutually exclusive with image_url.",
          },
          image_mime_type: {
            type: "string",
            description:
              "MIME type when supplying image_base64. Defaults to image/png.",
            default: "image/png",
          },
          description: {
            type: "string",
            description:
              "Natural-language description of what the image shows and what should be highlighted or emphasized.",
          },
          template_id: {
            type: "string",
            description:
              "Template ID controlling visual style. Standard options: glassmorphic, clean_minimal, bold_marketing, dark_professional, documentation.",
          },
          aspect_ratio: {
            type: "string",
            description:
              "Optional. One of: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.",
          },
          image_size: {
            type: "string",
            enum: ["1K", "2K", "4K"],
            description: "Optional output resolution tier. Defaults to backend choice.",
          },
        },
        required: ["description", "template_id"],
        additionalProperties: false,
      },
    } as const;
  • src/index.ts:57-58 (registration)
    Tool registration: the switch statement in the CallToolRequestSchema handler routes to runGenerate when generateTool.name ('markitup_generate') is matched.
    case generateTool.name:
      return await runGenerate(api, args ?? {});
  • src/index.ts:41-47 (registration)
    The generateTool is included in the tools array sent to ListToolsRequestSchema, registering it as an available MCP tool.
    const tools: Tool[] = [
      balanceTool as unknown as Tool,
      generateTool as unknown as Tool,
      regenTool as unknown as Tool,
      extendTool as unknown as Tool,
      bgremoveTool as unknown as Tool,
    ];
  • Helper functions: fetchAsDataUrl fetches a URL and converts it to a data URL; parseDataUrl parses a base64 data URL into mimeType and data components.
    async function fetchAsDataUrl(url: string): Promise<string> {
      const res = await fetch(url);
      if (!res.ok) {
        throw new Error(`Failed to fetch image_url (${res.status}): ${url}`);
      }
      const buf = Buffer.from(await res.arrayBuffer());
      const contentType = res.headers.get("content-type") ?? "image/png";
      return `data:${contentType};base64,${buf.toString("base64")}`;
    }
    
    function parseDataUrl(dataUrl: string): { mimeType: string; data: string } | null {
      const match = dataUrl.match(/^data:([^;]+);base64,(.+)$/);
      if (!match) return null;
      return { mimeType: match[1], data: match[2] };
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully carries behavioral disclosure. It reveals the multi-model pipeline (Claude for copy, Gemini for visuals), credit cost, required mutual exclusivity of image inputs, and common template IDs. It does not cover error handling, rate limits, or what happens if both inputs are provided, but covers key operational constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (about 100 words) and well-structured. It starts with the primary purpose, then covers input constraints, template options, and output. Every sentence adds value with no redundancy or filler. It is efficiently front-loaded for an agent to quickly understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description compensates by stating what is returned (generated images and copy). It covers all inputs, template styles, and credit cost. Minor gaps include lack of mention of image size limits, number of variations, or failure modes, but overall it is thorough enough for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds context beyond the schema: it explains the pipeline, the mutual exclusivity requirement, and common template IDs. It also clarifies the purpose of parameters like description and aspect_ratio. This extra guidance justifies a score above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: generate polished marketing-visual variations of a screenshot using a two-AI pipeline. It specifies the verb (generate), resource (marketing visuals), and key details (input as URL or base64, template IDs, output including copy). This is specific and distinct from siblings like markitup_extend.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for creating marketing variations from an image, but does not explicitly state when to use this tool versus its siblings (e.g., markitup_extend, markitup_regen). No when-not-to-use guidance or alternative recommendations are provided, leaving the agent to infer context from sibling names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/smythmyke/markitup-mcp-server'

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