Skip to main content
Glama

Upload a File (Text or Binary)

litewrite_upload_file
Destructive

Upload or overwrite files in a Litewrite project, including images, PDFs, and text, using a relative path.

Instructions

Upload a file to Litewrite, creating or overwriting it (POST /api/internal/files/upload).

Use for binary assets (images, PDFs) where edit/create are unsuitable, or as an alternative to create.

Args (provide exactly one source):

  • projectId (string, required): The project id.

  • filePath (string, required): Relative target path, e.g. "figures/logo.png".

  • content (string, optional): The text content to upload.

  • contentBase64 (string, optional): The raw file data base64-encoded.

  • overwrite (boolean, optional): Allow overwriting an existing file; default false.

Returns a confirmation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNoText content to upload
filePathYesRelative target path
overwriteNoOverwrite an existing file (default false)
projectIdYesThe Litewrite project id
contentBase64NoRaw file data, base64 encoded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, idempotentHint=false, and readOnlyHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: it may create OR overwrite, overwrite defaults to false, and the endpoint is disclosed. It does not mention auth requirements or what happens on failure, keeping 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.

Conciseness4/5

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

Front-loaded with purpose, endpoint, and usage nuance before the argument list, which is easy to scan. It loses a little by restating schema field descriptions nearly verbatim in the Args block, but nothing is padded or out of order.

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?

For a 5-parameter mutation tool with no output schema, the description covers purpose, endpoint, the create-vs-overwrite behavior, the source-content exclusivity rule, and the return ("a confirmation"). Nothing an agent needs to call 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 coverage is 100%, so baseline would be 3. However, the description adds a genuinely useful constraint absent from the schema: "provide exactly one source" for content vs contentBase64, which the flat schema with additionalProperties=false cannot express. It also clarifies filePath is relative ("figures/logo.png").

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?

The description gives a specific verb+resource ("Upload a file to Litewrite, creating or overwriting it") and explicitly positions it against siblings: for binary assets "where edit/create are unsuitable, or as an alternative to create." An agent can route between upload_file, create_file, and write_file from the description alone.

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?

It states a clear use condition (binary assets such as images and PDFs) and names an alternative (create). There is no explicit when-not guidance, e.g. that text files should use write_file/create_file instead of this tool, so it falls short of full routing guidance.

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