Skip to main content
Glama

Start a direct media upload

media_presign

Use this only when you can HTTP PUT the file bytes yourself (a shell or code runtime). Web and mobile chat clients cannot, so do not call it there: for a file on the person's device use media_upload_link, for a public https address use media_from_url. Returns a media id and a one-time uploadUrl. PUT the file bytes to uploadUrl with the same contentType, then call media_complete. Images: image/jpeg, image/png, image/webp, image/gif, up to 20MB. Video: video/mp4, video/quicktime, video/webm, up to 8GB, 43200 seconds, 4096px wide. Aspect ratio up to 20:1. Any image pixel width is fine. Documents for DM automations only (deliver.mediaId), not for posts: application/pdf, application/x-hwp, application/hwp+zip (.pdf, .hwp, .hwpx), up to 25MB. If you can see the image, write altText describing it. The response has mediaExpiresAt: this media id disappears after that time if it was never published, and publish will then fail with media_expired.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytesYesFile size in bytes
widthNoPixel width, if you know it
heightNoPixel height, if you know it
altTextNoWhat the image shows, for people using screen readers. Write it whenever you can see the image. Applied to carousel items.
fileNameYes
aiGeneratedNotrue when the image or video was generated or substantially changed with AI. Naver Blog photos get its AI-use label; Instagram, YouTube and TikTok get their AI declaration turned on unless you set it to false. Leave it out when unsure.
contentTypeYesimage/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime or video/webm or application/pdf or application/x-hwp or application/hwp+zip
workspaceIdNoWhich workspace this is for. Only needed when the account has more than one — the error tells you the ids when it matters. Leave it out if it is already decided; do not ask the person again.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / contentType / description
      Previous value: -"image/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime or video/webm"New value: +"image/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime or video/webm or application/pdf or application/x-hwp or application/hwp+zip"
  2. Changed1 schema field changed
    • changedInput schema / properties / aiGenerated / description
      Previous value: -"true when the image or video was generated or substantially changed with AI. Naver Blog photos get its AI usage label (AI 활용 설정); Instagram, YouTube and TikTok get their AI declaration turned on unless you set it to false. Leave it out when unsure."New value: +"true when the image or video was generated or substantially changed with AI. Naver Blog photos get its AI-use label; Instagram, YouTube and TikTok get their AI declaration turned on unless you set it to false. Leave it out when unsure."
  3. Changed1 schema field changed
    • addedInput schema / properties / aiGenerated
      Added value: +{
      +  "description": "true when the image or video was generated or substantially changed with AI. Naver Blog photos get its AI usage label (AI 활용 설정); Instagram, YouTube and TikTok get their AI declaration turned on unless you set it to false. Leave it out when unsure.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / contentType / description
      Previous value: -"image/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime"New value: +"image/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime or video/webm"
  5. Changed1 schema field changed
    • changedInput schema / properties / contentType / description
      Previous value: -"image/jpeg or image/png or video/mp4 or video/quicktime"New value: +"image/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime"
  6. Changed2 schema fields changed
    • changedInput schema / properties / contentType / description
      Previous value: -"image/jpeg or image/png"New value: +"image/jpeg or image/png or video/mp4 or video/quicktime"
    • addedInput schema / properties / workspaceId
      Added value: +{
      +  "description": "Which workspace this is for. Only needed when the account has more than one — the error tells you the ids when it matters. Leave it out if it is already decided; do not ask the person again.",
      +  "type": "string"
      +}
  7. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations are minimal (readOnlyHint=false, destructiveHint=false, openWorldHint=false), and the description carries the rest: the uploadUrl is one-time, a follow-up call to media_complete is required, and the returned mediaExpiresAt means an unpublished id vanishes and later publish calls fail with media_expired. Per-type MIME lists, byte caps (20MB/8GB/25MB), duration, resolution and aspect-ratio limits are all disclosed.

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?

Front-loads the gating condition and alternative routing before any format detail, which is the right order for the agent's decision. It is long, but nearly every sentence carries a constraint or a downstream step; only the 'Any image pixel width is fine' remark is close to filler.

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?

There is no output schema, so the description takes on the burden of describing the return payload (media id, uploadUrl, mediaExpiresAt) and the full multi-step lifecycle through media_complete. Given the tool's complexity and the file-type-dependent constraints, an agent has everything it needs to call it correctly in one pass.

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?

Schema coverage is already 88%, so the baseline is 3. The description goes further by tying parameter values to constraints the schema only names: which content types are valid images vs video vs documents, that documents are for DM automations (deliver.mediaId) and not posts, and that contentType must be reused when PUTting bytes. It does not, however, add anything for fileName or the width/height fields beyond the schema.

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 a specific verb and resource (start/direct media upload) and immediately distinguishes itself from the three sibling tools in the same family (media_upload_link, media_from_url, media_complete). It also spells out the artifact produced (a media id and a one-time uploadUrl), so the agent knows exactly what it gets.

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

Usage Guidelines5/5

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

Explicit when-to-use and when-NOT-to-use: 'Use this only when you can HTTP PUT the file bytes yourself... Web and mobile chat clients cannot, so do not call it there.' It names both alternatives and the condition that routes to each (on-device file -> media_upload_link, public https URL -> media_from_url). Nothing is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources