| list_parametersA | List Maginary prompt-DSL parameters. Args:
category: Restrict to one category (e.g. ``composition``, ``video``,
``model``, ``outpaint``). Call with no filters once — the response's
``categories`` / ``statuses`` maps are the full taxonomy.
status: Restrict to one status (``live``, ``mostly-dead``,
``unimplemented``).
include_reserved: When False (default) drop ``unimplemented``
(recognized-but-blocked) parameters from the result.
Returns:
A dict with ``count``, ``source`` (``live`` vs. ``bundled-snapshot``),
``categories`` / ``statuses`` (the filter taxonomy), and ``parameters``
(the array of matching entries).
|
| search_parametersA | Text-search over parameter names, aliases, descriptions, values, examples. Args:
query: Substring match, case-insensitive.
category: Optional single-category restriction.
include_reserved: Whether to include ``unimplemented`` parameters.
Returns:
Dict with ``count``, ``source`` (``live`` vs. ``bundled-snapshot``),
and ``parameters`` (ordered as they appear in the catalog).
|
| get_parameterA | Return the full record for a single parameter (canonical name or alias). Args:
name: Parameter name with or without leading ``--`` (e.g. ``ar``,
``--ar``, ``aspect``). Case-insensitive.
Returns:
The parameter dict. Not-found is an ``isError`` result — surface it
rather than fabricating a param.
|
| generateA | Kick off a generation via POST /api/gens/. Args:
prompt: The full prompt string, including any ``--flag`` parameters.
E.g. ``"a fox in autumn foliage --ar 16:9 --flagship"``.
Flags go at the END of the prompt. The ones people need most:
``--1`` / ``--2`` / ``--3`` / ``--4`` = how many images (default 4;
``--1`` for a single image, cheapest), ``--ar 16:9`` = aspect ratio,
``--v <model>`` = model. Anything else: call ``get_parameter(name)``
or ``search_parameters`` first — never guess a flag.
callback_url: Optional HTTPS URL that will receive a webhook when the
generation reaches done / failed. See
https://maginary.ai/blog/webhooks-guide for signature verification.
Returns:
On success, the created generation record. Key fields: ``uuid`` (use
to poll), ``action_type``, ``processing_state``,
``expected_output_count``.
On failure, an ``isError`` result instead (nothing is raised), with a
JSON body whose ``error`` field is one of:
- ``"auth"`` — no/invalid API key. Surface the message directly to
the human.
- ``"payment_required"`` — out of credits. The body carries
``billing_url`` and ``challenge``: either send the human to
``billing_url`` to top up, or pay programmatically via x402 —
``challenge`` is the standard x402 payment-required payload (USDC
on Base); settle it and retry this call.
- ``"failed"`` — anything else (invalid prompt, rate limit, backend
or network error); see ``message``.
x402 over MCP: a ``payment_required`` result also carries the x402
fields at the top level (``accepts``, ``resource``); an x402-capable
client signs ``accepts[0]`` and calls this tool again with the payment
in ``_meta["x402/payment"]``. The settled call returns the generation
with ``x402_receipt`` (and ``_meta["x402/payment-response"]``); a
wallet's first settlement also returns ``x402_account`` with an API
key — pass it as ``_meta["maginary/api_key"]`` on later calls (or as
the Authorization header of a new connection).
Every flag that exists, and its state: Flags, live (35): --ar, --output-count (--1/--2/--3/--4), --seed, --transparent, --sref, --sw, --png, --jpg, --webp, --svg, --2k, --4k, --upscale, --vary, --varysubtle, --varystrong, --panleft, --panright, --panup, --pandown, --zoomout, --mp4, --video-resolution (--480p/--540p/--720p/--1024p/--1080p/--2160p / --4k (4k, Seedance 2 Pro)/--480p24 / --480p24fps/--540p24 / --540p24fps/--720p24 / --720p24fps/--1024p30 / --1024p30fps/--1080p24 / --1080p24fps), --video-fps (--24fps/--30fps/--50fps/--60fps), --video-duration (--4s / --4sec/--5s / --5sec/--6s / --6sec/--8s / --8sec/--10s / --10sec/--12s / --12sec), --flagship, --sora, --soralite, --nanobananapro, --nb2, --gpt2, --gpt2high, --seedance2, --seedance2pro, --demo. Partial (4, only some models honour them): --no, --zoomout2x, --zoomoutexpand, --zoomoutexpand2x. Reserved (2, the parser rejects them): --cref, --cw. Any other --flag is rejected with Unrecognized parameter. Details: get_parameter(name). |
| get_generationA | Fetch a generation by UUID (GET /api/gens/{uuid}/). Args:
uuid: The UUID returned by ``generate``.
Returns:
The full generation record. If terminal, ``image_urls[]`` holds the
finished outputs and ``processing_result.slots[]`` the per-slot detail.
NOTE: a generation that failed server-side is a SUCCESSFUL tool call
returning ``processing_state: "failed"`` — always check the state,
never infer success from the absence of a tool error.
Hosted: a key obtained mid-session may be passed as
``_meta["maginary/api_key"]``.
|
| wait_for_generationA | Poll get_generation on a backoff until it reaches done / failed. Args:
uuid: The UUID returned by ``generate``.
timeout_s: Return after this many seconds even if still running.
Default 45 stays under the 60 s per-call limit most MCP clients
enforce; a ``timeout`` result just means "call again". Only raise
it (e.g. for video) on clients you know allow long tool calls.
Returns:
The terminal generation record — which includes generations that
failed server-side: those are SUCCESSFUL tool calls returning
``processing_state: "failed"`` with empty ``image_urls``, so always
check the state. On tool failure, an ``isError`` result whose
``error`` field is ``"timeout"`` (``message`` names the last
observed state — the generation keeps running server-side and can be
re-fetched with ``get_generation`` later), ``"auth"``, or
``"failed"``.
|
| create_accountA | Create a new Maginary account for the given email address. Returns the auto-generated password — display it to the user ONCE so they
can save it. A verification email is sent; the user must click the link
before the account can generate images.
After verification, use ``manage_api_key(action='create')`` with
``email`` + ``password`` to get an API key, then ``configure_api_key``
to activate it.
Args:
email: The user's email address.
Returns:
Dict with ``email``, ``password``, and ``message``. On failure, an
``isError`` result — e.g. ``error: "already_exists"`` (email taken:
ask the user for their password or a different email),
``"rate_limited"``, or ``"failed"``.
|
| check_account_statusA | Check account verification status, credit balance, and API key count. Use this after ``create_account`` to poll whether the user has clicked the
verification link. Pass ``email`` + ``password`` (from ``create_account``)
for Basic auth, or omit both to use the configured API key.
Args:
email: Account email (for Basic auth).
password: Account password (for Basic auth).
Returns:
Dict with ``verified`` (bool), ``email``, ``api_key_count``,
``credits_remaining``, ``uploads_remaining``.
|
| manage_api_keyA | Create, list, or revoke Maginary API keys (up to 10 per account). Auth: pass ``email`` + ``password`` for Basic auth (onboarding), or omit
both to use the configured API key (normal operation).
Args:
action: One of ``create``, ``list``, ``revoke``.
name: Key name (required for ``create``).
key_prefix: 8-char prefix of the key to revoke (required for ``revoke``).
email: Account email (for Basic auth).
password: Account password (for Basic auth).
Returns:
For ``create``: dict with ``raw_key`` (the full key — show once, then
use ``configure_api_key`` to activate it), ``key_prefix``, ``name``.
For ``list``: dict with ``keys`` array.
For ``revoke``: success/error message.
|
| configure_api_keyA | Activate an API key. Local (stdio) servers persist it; hosted does not. Call this after ``manage_api_key(action='create')`` returns a ``raw_key``.
On a local server the key is saved to ``~/.config/maginary/api_key``
(chmod 600) and survives restarts. On the hosted server
(mcp.maginary.ai) nothing can be stored — auth is per-request: the
response will say ``persisted: false`` and the key must be sent as an
``Authorization: Bearer <key>`` header on every request (set it in the
MCP client's connection config).
Args:
api_key: The full API key string returned by ``manage_api_key``.
Returns:
Confirmation dict.
|
| get_productsA | List available Maginary products/plans with pricing. No authentication required. Use this to present purchase options to the
user. The ``novice_pack`` ($10, 150 credits) is the recommended starting
point.
Returns:
Dict with ``count`` and ``products`` — each product carries ``id``,
``short_name``, ``title``, ``description``, ``price_cents``,
``credits``, ``uploads``, ``is_subscription``. (The backend sends a
bare array; it is wrapped here because FastMCP validates tool output
against the dict annotation and rejects a top-level list.)
|
| checkoutA | Create a Stripe checkout session for purchasing a product. Returns a ``checkout_url`` — the user must open it in a browser to
complete payment. After payment, credits are provisioned automatically
via webhook.
If the agent has a USDC wallet, skip this entirely — just call
``generate`` and the x402 protocol handles payment on-chain.
Args:
product_id: Product ID from ``get_products``.
email: Account email (for Basic auth during onboarding).
password: Account password (for Basic auth during onboarding).
Returns:
Dict with ``checkout_url``. On failure, an ``isError`` result — e.g.
``error: "email_not_verified"`` until the user clicks the
verification link, or ``"auth"`` / ``"failed"``.
|
| get_balanceA | Check remaining credits and uploads for the authenticated account. Args:
email: Account email (for Basic auth).
password: Account password (for Basic auth).
Returns:
Dict with ``credits_remaining`` and ``uploads_remaining``.
|