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; pass command: true to always get that command when you can run shell commands and the file is on this machine. 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.

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": {
      "projectId": "<projectId>"
    },
    "name": "upload_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandNotrue when you can run shell commands and the image is a file on this machine: the reply carries uploadCommand even where an upload box would show. Leave it out in chat apps.
projectIdYesThe project ID

Output Schema

NameRequiredDescriptionDefault
expiresAtYes
projectIdYes
uploadCommandNoOne-time curl command that uploads a local file by its path; only where no upload box shows
uploadEndpointYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / command
      Added value: +{
      +  "description": "true when you can run shell commands and the image is a file on this machine: the reply carries uploadCommand even where an upload box would show. Leave it out in chat apps.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / uploadCommand
      Added value: +{
      +  "description": "One-time curl command that uploads a local file by its path; only where no upload box shows",
      +  "type": "string"
      +}
  3. 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"
      +}
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare write/openWorld/destructive; the description adds substantial context beyond them — that it opens an upload box in view-capable chat clients, uploads into the project's media library, returns an asset URL to wire into media.src, and falls back to a one-time curl command on terminal clients. It does not address why destructiveHint is set or whether library assets can be overwritten, so it stops 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the trigger condition, then the client-dependent behaviors, then sibling routing; every sentence carries information. Slight redundancy in explaining the command flag twice (description and schema) keeps it from a 5.

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?

With only two parameters, a full schema, an output schema, and annotations, the description covers everything an agent needs: trigger condition, environment-dependent behavior, return value usage, and alternative tools.

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 coverage is 100% and the command parameter's meaning is already spelled out in the schema description, so the prose largely restates it. The one added nuance — 'leave it out in chat apps' — is helpful but marginal, keeping this at the baseline.

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 ('upload_image' for a LOCAL image the user wants on a page) and explicitly separates it from the sibling upload_asset by input type. An agent can route between the two 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 conditions (pasted image or file on the user's machine), the exclusion rule for public URLs (use upload_asset(sourceUrl)), and a precise condition for the command flag (shell access plus local file path). 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.