Skip to main content
Glama

upload_media

Uploads a base64-encoded file with its filename and MIME type to the Strapi Media Library, returning an ID for referencing the file in content entries.

Instructions

Upload a new file to the Strapi Media Library. Provide the file as base64-encoded data with a filename and MIME type. After uploading, the file can be referenced in content entries via its ID.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_name": "<file_name>",
      "base64_data": "<base64_data>",
      "mime_type": "<mime_type>"
    },
    "name": "upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_nameYesFile name with extension, e.g. "photo.jpg"
mime_typeYesMIME type, e.g. "image/jpeg", "image/png"
base64_dataYesBase64 encoded file content

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the transport format (base64) and that the response yields an ID usable in content entries, but omits permission requirements, size/type limits, and duplicate-filename behavior for what is clearly a write operation.

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?

Three short sentences, front-loaded with the action and followed by the payload contract and the post-upload consequence. No sentence is redundant or padded.

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 a three-required-parameter upload tool with no annotations and no output schema, the description covers the essentials: what it does, what the input must look like, and what the agent gets back (an ID). Remaining gaps around limits, failure modes, and auth are real but secondary.

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 three parameters are already documented in the schema with examples. The description only restates that the file arrives as base64 with a filename and MIME type, adding no new syntax or constraint information, so the baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource ("Upload a new file to the Strapi Media Library") that an agent can distinguish from list_media and update_media by the word "new" and the upload framing. It never explicitly contrasts with those siblings, but the operation is unambiguous.

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?

Implies usage context by requiring base64 data, a filename, and a MIME type, and tells the agent what the uploaded file can be used for afterward (referencing by ID). It gives no when-not guidance, no mention of update_media for replacing existing files, and no preconditions such as auth or size limits.

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