Skip to main content
Glama

Upload image from the chat

upload_image
Destructive

Use this when the user has a LOCAL image (pasted into the chat, or a file on their machine) that they want on a page. In chat apps that show views it opens an upload box in the chat where the user drops the image; it uploads straight to the project's media library and returns the asset URL, which you then set as a section media.src. In clients without views (terminal clients such as Claude Code) it returns a one-time curl command that uploads a local file by its path instead. Prefer this over upload_asset for user-supplied local images (a pasted image's bytes never reach you, so you cannot upload it yourself). For an image that already has a public URL, use upload_asset(sourceUrl) instead.

Input Schema

NameRequiredDescriptionDefault
projectIdYesThe project ID

Output Schema

NameRequiredDescriptionDefault
expiresAtYes
projectIdYes
uploadEndpointYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "expiresAt": {
      +      "type": "number"
      +    },
      +    "projectId": {
      +      "type": "string"
      +    },
      +    "uploadEndpoint": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "uploadEndpoint",
      +    "projectId",
      +    "expiresAt"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false and destructiveHint=true; the description adds substantial context the annotations cannot convey — dual execution modes (view clients open a chat upload box; terminal clients return a one-time curl command), and where the bytes land (project media library, asset URL). It doesn't reconcile why destructiveHint is true for what reads as an additive upload, which keeps it short of a 5.

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?

The operative condition ('LOCAL image… on a page') is front-loaded, then the two client modes, then the routing rule versus upload_asset. Lengthy but every sentence changes an agent decision; nothing is redundant.

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?

Complete for a one-parameter tool. It covers both runtime branches, what is returned in each (asset URL vs curl command), and the downstream action (setting media.src). An output schema exists, so return-value documentation is a bonus rather than a gap.

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?

Single parameter (projectId) with 100% schema description coverage, so the schema already does the work. The description adds no format or constraint detail beyond it; baseline 3 is appropriate.

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+resource ('upload image') and immediately scopes it: a LOCAL image the user wants on a page. It explicitly separates itself from upload_asset by input type, so an agent can pick between them without opening either 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 when-to-use ('user has a LOCAL image… pasted into the chat, or a file on their machine'), and names two alternatives with their selection conditions: upload_asset(sourceUrl) for public URLs, and the terminal-client path where bytes never reach the agent. No inference required.

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