Skip to main content

Overview

Use the Image MCP server from your ATXP-powered agent to create images based on a prompt.

Example prompts

  • “Create an image of a cat riding a horse. Use a realistic style.”
  • “Create a coloring page of a child and a puppy.”

Tools

Takes in a prompt, optional model, optional aspect ratio, and optional reference images. The output will be a URL to an image generated from the prompt. The image will be stored in the cloud and will expire in 180 days.

Arguments

Accepts a JSON object with the following properties:
string
required
The natural-language prompt to use to generate the image.
string
Optional model to use for image generation. If not specified, uses the default model from environment variables.OpenAI models: gpt-4o, gpt-4o-mini, gpt-image-1, dall-e-3Gemini models: imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, imagen-4.0-fast-generate-001, imagen-3.0-generate-002, gemini-3-pro-image-preview
string
Optional aspect ratio for the generated image. Defaults to 1:1 if not specified.OpenAI supported ratios: 1:1 (square), 16:9 (landscape), 9:16 (portrait)Gemini supported ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
array
Optional array of reference images to incorporate into the generation. Images will be fetched from the provided URLs.

Response

Returns a JSON object with the following properties:
string
The status of the image generation operation. Returns “success” when the image is generated successfully.
string
The URL that the image is accessible at for 1 day.
Takes in a prompt, optional model, optional aspect ratio, and optional reference images, then starts asynchronous image generation. Returns a task ID that can be used to check status and retrieve the result. The image will be stored in the cloud and will expire in 180 days.

Arguments

Accepts a JSON object with the following properties:
string
required
The natural-language prompt to use to generate the image.
string
Optional model to use for image generation. If not specified, uses the default model from environment variables.OpenAI models: gpt-4o, gpt-4o-mini, gpt-image-1, dall-e-3Gemini models: imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, imagen-4.0-fast-generate-001, imagen-3.0-generate-002, gemini-3-pro-image-preview
string
Optional aspect ratio for the generated image. Defaults to 1:1 if not specified.OpenAI supported ratios: 1:1 (square), 16:9 (landscape), 9:16 (portrait)Gemini supported ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
array
Optional array of reference images to incorporate into the generation. Images will be fetched from the provided URLs.

Response

Returns a JSON object with the following properties:
string
A unique task identifier that can be used with image_get_image_async to check the status and retrieve the result.
Retrieves the status and result of an asynchronous image generation task using the task ID. Tasks expire after 12 hours.

Arguments

Accepts a JSON object with the following properties:
string
required
The task ID returned from image_create_image_async.

Response

Returns a JSON object with the following properties:
string
The current status of the task. Can be “pending”, “processing”, “completed”, or “failed”.
string
The URL that the image is accessible at for 180 days. Only present when status is “completed”.

Usage

1

Define the Image service

Create a reusable service configuration that points to the MCP server and standardizes how you pass arguments and read results. This lets your agent easily interact with the Image tools in a consistent manner.
2

Create an ATXP client

Create a client using an ATXP account by importing the ATXP client SDK and other dependencies.
3

Use the Image service in your agent

Call the Image tool by passing your natural-language instruction as the argument the getArguments method.Read the response using the getResult method.
You should see the result of the image creation printed in your console.
Using model and aspect ratio:
Using reference images: