Skip to main content
Glama

Upload a photo or clip

upload_media

A photo or a short clip for a post; pass its mediaId to create_post. An image in this conversation goes as file. Otherwise url (public https), upload (you can make HTTP requests) or base64 (no network, photos ≤ 2 MB). Only what they asked for; nothing shows until a post passes the check.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
hNo
wNo
asNoWhich of what they run: its name or a key from list_identities. Left out when only one fits.
urlNoA public https link to the file. Example: "https://example.com/photos/lag.jpg"
fileNoAn image from this conversation (ChatGPT passes it here).
kindNoimage (default) or video.
base64NoThe photo as base64, ≤ 2 MB decoded.
uploadNoInstead of url: you PUT the bytes yourself to the uploadUrl you get back.
durationSNovideo: its length in seconds (≤ 60). Example: 14.5
posterUrlNovideo + url: a https link to a still frame (JPEG/PNG/WebP).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / as / description
      Previous value: -"Which of what the person runs — a key from list_identities, e.g. \"forening:a1b2c3d4e5\" or \"channel:Xy12Ab34Cd\", or its name, e.g. \"Löparklubben\". May be left out when only one fits."New value: +"Which of what they run: its name or a key from list_identities. Left out when only one fits."
    • changedInput schema / properties / base64 / description
      Previous value: -"Instead of url/upload: the photo's bytes as base64 (a data:image/…;base64, prefix is fine), ≤ 2 MB decoded. For clients without network access."New value: +"The photo as base64, ≤ 2 MB decoded."
    • removedInput schema / properties / file / additionalProperties
      Removed value: -false
    • removedInput schema / properties / upload / additionalProperties
      Removed value: -false
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "as": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "key": {
      -          "type": "string"
      -        },
      -        "name": {
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "key",
      -        "name"
      -      ],
      -      "type": "object"
      -    },
      -    "expiresAt": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "kind": {
      -      "type": "string"
      -    },
      -    "mediaId": {
      -      "type": "string"
      -    },
      -    "note": {
      -      "type": "string"
      -    },
      -    "status": {
      -      "enum": [
      -        "ready",
      -        "upload"
      -      ],
      -      "type": "string"
      -    },
      -    "uploadHeaders": {
      -      "anyOf": [
      -        {
      -          "additionalProperties": {
      -            "type": "string"
      -          },
      -          "type": "object"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ]
      -    },
      -    "uploadUrl": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "required": [
      -    "mediaId",
      -    "kind",
      -    "status",
      -    "as",
      -    "uploadUrl",
      -    "uploadHeaders",
      -    "expiresAt",
      -    "note"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. Changed1 schema field changed
    • addedInput schema / properties / file
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "An image from this conversation (ChatGPT passes it here).",
      +  "properties": {
      +    "download_url": {
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / base64
      Added value: +{
      +  "description": "Instead of url/upload: the photo's bytes as base64 (a data:image/…;base64, prefix is fine), ≤ 2 MB decoded. For clients without network access.",
      +  "maxLength": 2900000,
      +  "type": "string"
      +}
  4. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare non-read-only, non-destructive, non-idempotent and closed-world, so the description need not repeat the safety profile. It adds real behavioral context the annotations lack: nothing is published until a post passes the check, and 'only what they asked for' signals a scope constraint on what should be uploaded. It does not cover error behavior or what happens to uploads never attached to a post.

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?

Two dense sentences with no filler; the purpose and the mediaId hand-off come first, then the source-mode options in a compact parenthetical. Phrasing like 'Only what they asked for' is terse to the point of being slightly cryptic, but every clause carries information.

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 10-parameter tool with no output schema, the description does the important work: it explains that a mediaId comes back and feeds create_post, and that `upload` mode requires the caller to PUT bytes to a returned uploadUrl. The remaining gap is the completion of that upload handshake — whether a second call is needed once the PUT finishes — which the description never clarifies.

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 80%, yet the description adds selection logic the schema cannot express — which source parameter to use under which environment constraints, plus the 2 MB ceiling for base64. It does not explain `w`/`h` (undocumented in the schema) or when `kind`, `durationS` and `posterUrl` are mandatory, leaving a few gaps.

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?

The description states the resource (a photo or short clip for a post) and its downstream role — 'pass its mediaId to create_post' — which cleanly separates it from the sibling create_post that actually publishes. The upload verb itself is carried only by the name/title rather than restated, but the resource and return contract are unambiguous.

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?

It gives concrete routing rules for the mutually exclusive source modes: conversation image goes as `file`, otherwise `url` for public https, `upload` when the caller can make HTTP requests, `base64` when there is no network. That is genuine decision guidance, though it addresses parameter choice rather than when to use this tool versus alternatives such as set_place_picture.

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.