Skip to main content
Glama

Upload Asset

upload_asset

Upload or replace files in the LightCMS asset library. Supports large files via local paths and validates file types for security.

Instructions

Upload or replace an asset in the asset library. Re-uploading to the same serve_path replaces the existing file in place — no need to delete first.

Provide file content via one of:

  • file_path: Absolute local path to the file (preferred for files >100KB — avoids MCP transport size limits)

  • data_base64: Base64-encoded file content (fine for small files)

Validates file type and MIME type for security.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_base64NoBase64-encoded file content. Use for small files (<100KB). For larger files, prefer file_path.
descriptionNoOptional description of the asset
file_pathNoAbsolute local filesystem path to read the file from. Preferred over data_base64 for large files — avoids MCP transport size limits.
filenameYesOriginal filename with extension,required
serve_pathYesURL path where file will be served (e.g., /images/logo.png),required
Behavior4/5

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

Adds security validation behavior ('Validates file type and MIME type') and infrastructure constraints ('MCP transport size limits') not present in annotations. Clarifies upsert/replacement semantics. Annotations declare non-destructive operation, and description frames replacement as a convenience feature rather than data destruction.

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?

Three tightly focused paragraphs: action/replacement behavior, content provision options with clear bullet structure, and validation notice. No redundant text; every sentence conveys distinct operational information. Well front-loaded with primary action.

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?

Comprehensive coverage of upload semantics, security constraints, and transport limitations for a 5-parameter file operation. Absence of output schema is noted but description sufficiently covers input concerns and behavioral expectations for successful invocation.

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?

With 100% schema coverage (baseline 3), description adds crucial semantic guidance: specifies mutual exclusivity ('via one of'), size thresholds (>100KB) for choosing between file_path and data_base64, and explains the replacement semantics of serve_path parameter beyond the schema's basic definition.

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 specific action ('Upload or replace') and resource ('asset in the asset library'). Explicitly distinguishes from sibling delete_asset by noting replacement happens 'in place — no need to delete first', and implicitly distinguishes from upload_asset_from_url by specifying local file content provision methods.

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?

Provides clear operational guidance: explains replacement behavior (re-uploading to same serve_path replaces existing file) and selection criteria for content sources (file_path preferred for >100KB to avoid transport limits vs data_base64 for small files). Stops short of explicitly naming upload_asset_from_url as the alternative for remote URLs.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonradoff/lightcms'

If you have feedback or need assistance with the MCP directory API, please join our Discord server