Skip to main content
Glama
askads

Yandex Direct MCP

Загрузить изображение

upload_ad_image

Uploads an image from a public URL or base64 data to the Yandex Direct image library and returns its AdImageHash for use in a text-and-image ad.

Instructions

Загружает изображение в библиотеку изображений (adimages/add) и возвращает его AdImageHash — этот хеш подставляется в поле AdImageHash текстово-графического объявления. Изображение передаётся публичным URL (сервер сам скачает и закодирует) или в base64 через imageData. Яндекс принимает JPG/PNG/GIF до 10 МБ; текстово-графическому объявлению нужна горизонтальная картинка (минимум 1080×607).

Input Schema

NameRequiredDescriptionDefault
urlNoПубличный URL изображения; сервер скачает его и закодирует в base64. Нужно передать это поле или imageData.
nameYesНазвание изображения в библиотеке.
imageDataNoБайты изображения в base64 (префикс data:-URL отбрасывается). Нужно передать это поле или url.
client_loginNoЛогин клиента агентства или кабинета в управлении (из list_clients). Если не указан — YANDEX_DIRECT_LOGIN из конфигурации, а без него собственный аккаунт токена.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.6.0
    • addedInput schema / properties / client_login
      Added value: +{
      +  "description": "Логин клиента агентства или кабинета в управлении (из list_clients). Если не указан — YANDEX_DIRECT_LOGIN из конфигурации, а без него собственный аккаунт токена.",
      +  "pattern": "^[A-Za-z0-9][A-Za-z0-9._@-]{0,99}$",
      +  "type": "string"
      +}
  2. Changed3 schema fields changedv1.5.1
    • changedInput schema / properties / imageData / description
      Previous value: -"Base64-encoded image bytes (a data: URL prefix is stripped). Provide this or url."New value: +"Байты изображения в base64 (префикс data:-URL отбрасывается). Нужно передать это поле или url."
    • changedInput schema / properties / name / description
      Previous value: -"Image name shown in the library."New value: +"Название изображения в библиотеке."
    • changedInput schema / properties / url / description
      Previous value: -"Public image URL; fetched and base64-encoded server-side. Provide this or imageData."New value: +"Публичный URL изображения; сервер скачает его и закодирует в base64. Нужно передать это поле или imageData."
  3. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover non-read-only, open-world, non-idempotent, and non-destructive behavior. The description adds useful operational details: the server downloads and encodes the URL, accepted formats and size limit, and the horizontal image requirement for text-graphic ads.

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 compact and front-loaded: it first states the upload action and returned hash, then gives the supported input methods and image constraints. Every sentence contributes necessary context.

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?

For an upload tool with annotations and a fully described schema, the description is nearly complete: it explains the return value, input alternatives, and image requirements. Minor gaps remain around overwrite behavior and error handling, but these are not critical for correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the parameters are already documented. The description reinforces the URL-vs-imageData choice and adds relevant image constraints, but does not significantly elaborate beyond what the schema already provides.

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?

States the specific action (uploading an image to the ad image library via adimages/add), the result (AdImageHash), and how that result is used in a text-graphic ad. This clearly distinguishes it from sibling read tools such as get_ad_images.

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

Usage Guidelines4/5

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

Explains the primary use case: obtaining an AdImageHash for a text-graphic ad, with the image supplied either by public URL or base64. It gives clear context and constraints, though it does not explicitly mention alternatives such as listing existing images with get_ad_images.

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