Skip to main content
Glama

upload_media

Upload media files to the Shopline media library and obtain a media ID for use with products.

Instructions

[WRITE] 上傳媒體檔案至 Shopline。

【用途】 上傳圖片或其他媒體檔案至 Shopline 媒體庫,上傳後可取得媒體 ID 供商品圖片等用途使用。 注意:Shopline API 可能需要 multipart/form-data,本工具目前以 JSON body 傳送, 若 API 回傳格式錯誤,請改用 multipart 上傳方式。

【呼叫的 Shopline API】

  • POST /v1/media

【回傳結構】 dict 含 success: bool, resource_id: str, message: str, media: dict。

【副作用】

  • 在 Shopline 媒體庫中新增一筆媒體記錄

  • 上傳的檔案將佔用商店的媒體儲存空間

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_dataYes媒體上傳資料。可能需要包含 file_url(遠端 URL)或 base64 編碼的檔案內容,視 Shopline API 支援的格式而定。範例:{"file_url": "https://your-cdn.shoplineapp.com/image.jpg", "type": "image"}
Behavior5/5

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

Even without annotations, the description fully discloses the tool's behavior: it calls POST /v1/media, lists side effects (adds record, consumes storage), and describes the return structure. The note about the JSON body limitation adds transparency about potential failure modes.

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

Conciseness4/5

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

The description is well-structured with labeled sections, front-loads the action and purpose, and includes necessary details without excessive verbosity. Slight redundancy exists between the schema description and the note, but overall efficient.

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

Completeness5/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 provides the return structure and side effects, making it complete for an upload tool with one parameter. It covers the essential aspects needed for correct invocation and understanding of consequences.

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?

The schema has 100% description coverage with a good explanation of the param (media_data). The description adds value by explaining the return structure and the possible formats (file_url or base64) beyond what the schema says, as well as the multipart workaround.

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 action ([WRITE]) and resource (upload media files to Shopline media library), explains the purpose of obtaining a media ID for product images, and distinguishes it from sibling tools like add_product_images by specifying it uploads to the media library.

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?

The description provides a note about the multipart requirement and a workaround if the API returns a format error, offering guidance on when the tool might fail and how to handle it. It does not explicitly compare to other tools, but the sibling list shows no direct alternative for uploading media.

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/asgard-ai-platform/mcp-shopline'

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