Skip to main content
Glama

Upload asset

swebsy_upload_asset

Upload local images, fonts, videos, audio or PDFs into a site and get back an assetId, src, and usage snippet for components, links, or custom fonts.

Instructions

Upload a local image, font, video, audio or PDF file into the open site and return its assetId, src and a usage snippet. Images go in the asset library for image components, video for video components (attributes.src), audio for audio, PDFs as a link href; fonts are stored for update_settings fonts.custom. This is the ONLY way to get your own imagery (screenshots, logos, textures, mockups) into a site — an image with an empty src gets a random stock photo instead. Reads the file from the agent's own filesystem, so pass a path you can see (for example a screenshot you just captured). The asset is stored in the project and travels with static export and project JSON. Pass path or paths (exactly one). Several files: pass paths (up to 25) instead of path for one call that returns a compact {assets: {basename: src}, failed: {basename: reason}} map.

Input Schema

NameRequiredDescriptionDefault
pathNoAbsolute path to the file on the agent's machine. Pass `path` or `paths` (exactly one). Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Video: .mp4, .m4v, .webm, .mov, .ogv. Audio: .mp3, .m4a, .wav, .ogg. Documents: .pdf. Max 10 MB (the hosting per-file cap) — re-encode larger files first (for video: H.264 .mp4, 1080p or less, `-movflags +faststart`). Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped).
pathsNoBatch form: absolute paths of up to 25 files (same types and 10 MB cap as `path`). Pass `path` or `paths` (exactly one). Each file is uploaded on its own, so one bad file lands in `failed` without stopping the rest. Display names are the basenames; `filename` is not used.
filenameNoOptional display name in the asset library, single `path` only. Defaults to the file's own basename.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.13.1
    • changedInput schema / properties / filename / description
      Previous value: -"Optional display name in the asset library. Defaults to the file's own basename."New value: +"Optional display name in the asset library, single `path` only. Defaults to the file's own basename."
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to the file on the agent's machine. Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Video: .mp4, .m4v, .webm, .mov, .ogv. Audio: .mp3, .m4a, .wav, .ogg. Documents: .pdf. Max 10 MB (the hosting per-file cap) — re-encode larger files first (for video: H.264 .mp4, 1080p or less, `-movflags +faststart`). Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped)."New value: +"Absolute path to the file on the agent's machine. Pass `path` or `paths` (exactly one). Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Video: .mp4, .m4v, .webm, .mov, .ogv. Audio: .mp3, .m4a, .wav, .ogg. Documents: .pdf. Max 10 MB (the hosting per-file cap) — re-encode larger files first (for video: H.264 .mp4, 1080p or less, `-movflags +faststart`). Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped)."
    • addedInput schema / properties / paths
      Added value: +{
      +  "description": "Batch form: absolute paths of up to 25 files (same types and 10 MB cap as `path`). Pass `path` or `paths` (exactly one). Each file is uploaded on its own, so one bad file lands in `failed` without stopping the rest. Display names are the basenames; `filename` is not used.",
      +  "items": {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 25,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "path"
      -]
  2. Changed1 schema field changedv0.10.0
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to the file on the agent's machine. Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Max 10 MB — re-encode larger files first. Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped)."New value: +"Absolute path to the file on the agent's machine. Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Video: .mp4, .m4v, .webm, .mov, .ogv. Audio: .mp3, .m4a, .wav, .ogg. Documents: .pdf. Max 10 MB (the hosting per-file cap) — re-encode larger files first (for video: H.264 .mp4, 1080p or less, `-movflags +faststart`). Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped)."
  3. Changed1 schema field changedv0.9.0
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to the image on the agent's machine. Allowed types: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Max 10 MB — re-encode larger files first. Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped)."New value: +"Absolute path to the file on the agent's machine. Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Max 10 MB — re-encode larger files first. Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped)."
  4. First observedv0.8.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only say it is a non-destructive write; the description adds real behavioral context beyond that — reading from the agent's filesystem, the 10 MB hosting cap, SVG sanitization, assets persisting through static export and project JSON, and per-file failure isolation in batch mode.

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 purpose and return values, and each sentence carries information. The 'pass `path` or `paths` (exactly one)' constraint is repeated in both the prose and two schema fields, which is mild redundancy in an otherwise dense, well-ordered block.

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 no output schema, the description takes on return-value documentation itself (`assetId`/`src`/`usage`, and the batch map with `failed` reasons), plus size limits and persistence semantics. An agent has everything needed to call it correctly on the first try.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3, but the description adds value the schema lacks: the exact return shape for the batch form (`{assets, failed}`) and the consequence of mixing `path`/`paths`. That compensates for the absent output 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 (upload a local file into the open site) plus what it returns (`assetId`, `src`, `usage`), and maps each media type to its consumer (`image` components, `attributes.src`, fonts.custom). It is clearly distinct from siblings like `swebsy_list_assets` and `swebsy_delete_asset`.

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?

Gives strong context: this is the ONLY way to get custom imagery in, and an `image` with empty src gets a random stock photo — a concrete trigger explaining why to call it. It also explains single vs batch usage. It stops short of stating when not to use it (e.g. reusing an existing asset via `list_assets`) or naming sibling alternatives.

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