Skip to main content
Glama

Get Media Upload URLs

get_upload_urls

Get presigned upload URLs for direct file uploads. Returns uploadUrl (PUT your file here) and publicUrl (use in create_post mediaUrls). This only mints a URL. You MUST PUT the file to uploadUrl and confirm a 2xx response before using publicUrl, otherwise create_post/bulk rejects it with "Media file(s) not found in storage". If the PUT cannot reach uploadUrl, for example a sandbox network proxy answers 403 or the storage host is not on its allowlist, do not retry it, do not stop, and never put the files in a public repo or file-sharing link: call open_upload_widget and have the user add the files through the upload box or upload link it returns. If the files are ones you made, hand them to the user as downloads first. Prefer upload_media for public URLs and for inline files under 30 MB; use this for larger files you hold yourself. For each file, provide fileName and the mimeType that matches it. GIFs post only to Facebook, X, Bluesky, Mastodon, LinkedIn, Tumblr and WordPress, and the document types are for LinkedIn DOCUMENT posts. Keep the extension in fileName, since the post reads the file type from it. A publicUrl may be reused across any number of posts; the file is kept until the last post referencing it has published.

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": {
      "files": "<files>"
    },
    "name": "get_upload_urls"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesFiles to get upload URLs for, one entry per file you will PUT
workspaceIdNoWorkspace to act in: an id from list_workspaces. Omit to act in the workspace list_workspaces marks current. Use the same workspaceId for every call about the same workspace, since ids from one workspace (accounts, posts, uploads) do not exist in another

Output Schema

NameRequiredDescriptionDefault
resultYesAn object with urls: one { uploadUrl, publicUrl, key } entry per requested file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / files / description
      Previous value: -"Files to get upload URLs for"New value: +"Files to get upload URLs for, one entry per file you will PUT"
    • addedOutput schema / properties / result / additionalProperties
      Added value: +true
    • addedOutput schema / properties / result / properties
      Added value: +{
      +  "urls": {
      +    "anyOf": [
      +      {
      +        "items": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "expiresAt": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "fileName": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "key": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "publicUrl": {
      +              "description": "Public URL to reference in mediaUrls after upload. Reusable across posts; the file stays until the last post referencing it has published",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "uploadUrl": {
      +              "description": "PUT the file bytes to this URL",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ]
      +  }
      +}
    • addedOutput schema / properties / result / type
      Added value: +"object"
    • addedOutput schema / required
      Added value: +[
      +  "result"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / files / items / properties / mimeType / enum
      Previous value: -[
      -  "image/jpeg",
      -  "image/png",
      -  "image/webp",
      -  "video/mp4",
      -  "video/quicktime",
      -  "application/pdf",
      -  "application/vnd.ms-powerpoint",
      -  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
      -  "application/msword",
      -  "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
      -]New value: +[
      +  "image/jpeg",
      +  "image/png",
      +  "image/webp",
      +  "image/gif",
      +  "video/mp4",
      +  "video/quicktime",
      +  "application/pdf",
      +  "application/vnd.ms-powerpoint",
      +  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
      +  "application/msword",
      +  "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
      +]
  3. Changed2 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  4. Changed1 schema field changed
    • changedInput schema / properties / workspaceId / description
      Previous value: -"Workspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace (accounts, posts, uploads) do not exist in another"New value: +"Workspace to act in: an id from list_workspaces. Omit to act in the workspace list_workspaces marks current. Use the same workspaceId for every call about the same workspace, since ids from one workspace (accounts, posts, uploads) do not exist in another"
  5. Changed1 schema field changed
    • addedInput schema / properties / workspaceId
      Added value: +{
      +  "description": "Workspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace (accounts, posts, uploads) do not exist in another",
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • changedInput schema / properties / files / items / properties / mimeType / enum
      Previous value: -[
      -  "image/jpeg",
      -  "image/png",
      -  "image/webp",
      -  "video/mp4",
      -  "video/quicktime"
      -]New value: +[
      +  "image/jpeg",
      +  "image/png",
      +  "image/webp",
      +  "video/mp4",
      +  "video/quicktime",
      +  "application/pdf",
      +  "application/vnd.ms-powerpoint",
      +  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
      +  "application/msword",
      +  "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
      +]
  7. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the mutation/idempotency profile; the description adds the crucial behavior that minting a URL is not an upload, that the caller must PUT and confirm a 2xx before the publicUrl is usable, and the exact downstream error ('Media file(s) not found in storage'). It also discloses proxy/allowlist 403 cases, the no-retry rule, and file retention until the last referencing post publishes.

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?

Purpose and return values are front-loaded, and the safety-critical ordering (PUT first, then create_post) comes before the edge-case and platform detail. It is dense and long, with the multi-clause failure-path sentence packing several instructions together, but nearly every clause carries actionable content.

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?

An output schema exists, yet the description still names both returned fields and how to use each, and covers the full workflow contract (mint, upload, verify, then post) plus fallback. For a tool whose misuse causes downstream post failures, nothing needed to invoke it correctly is missing.

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 description coverage is 100%, so the baseline is 3; the description goes beyond it by requiring that mimeType matches fileName, that the extension be kept because the post infers the file type from it, and by explaining which media types work on which platforms. It does not elaborate on workspaceId, presumably covered by 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?

Opens with a specific verb and resource: 'Get presigned upload URLs for direct file uploads,' then immediately clarifies 'This only mints a URL' versus the actual upload step. It explicitly names upload_media and open_upload_widget as the alternatives it is not, so an agent can distinguish it from siblings without opening a schema.

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?

Gives explicit routing rules: 'Prefer upload_media for public URLs and for inline files under 30 MB; use this for larger files you hold yourself,' plus a hard failure-path rule to call open_upload_widget instead of retrying. It also states when a publicUrl can be reused. This is when-to-use, when-not-to-use, and fallback in one place.

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