Skip to main content
Glama

Encode or decode a local file as Base64

convert_file
Read-onlyIdempotent

Read a local file to encode its bytes as Base64 or decode a Base64 text file without pasting contents; files over 5 MB are rejected.

Instructions

Read a local file and encode its bytes to Base64, or decode a Base64 text file.

Use this when the data is in a file on this computer, so you don't have to paste it. The file is only read, never changed. Files larger than 5 MB are rejected; use the Apify version for bigger jobs. For decode, the file must be UTF-8 text containing Base64 (or a data URI), not a binary file.

path: full path to a file, up to 5 MB.

Returns the same result object as convert_text. If the decoded bytes are not UTF-8 text, "isText" is false and "text" is null.

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": {
      "path": "<path>"
    },
    "name": "convert_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFull path to a local file, up to 5 MB. For decode, the file must be UTF-8 text of Base64.
actionNoWhat to do. "auto" (default) decodes if the input looks like Base64, otherwise it encodes. Use "encode" or "decode" when you already know the direction.auto
data_uriNoIf true, encoded results also include a data: URI. The MIME type is guessed from the file name when we can.
url_safeNoIf true, encode with - and _ instead of + and /. Decoding always accepts both.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, and the description still adds value beyond them: a hard 5 MB rejection threshold, the UTF-8-only requirement for decode inputs, and the failure shape ('isText' false, 'text' null for non-UTF-8 decoded bytes). These are the operational limits an agent needs before calling.

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?

Content is front-loaded: purpose, then when-to-use, then limits, then the path parameter and return note. Slight redundancy remains, since the 5 MB cap and the UTF-8 decode requirement each appear twice (prose and path line).

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?

For a read-only conversion tool with no output schema, the description covers inputs, limits, and the notable null/'isText' edge case. The full result shape is delegated to convert_text ('same result object as convert_text'), which leaves a minor gap an agent must resolve elsewhere.

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 description coverage is 100%, so all four parameters including the action enum are already documented, and the baseline is 3. The description only restates the path constraint and the decode text requirement; it adds nothing about action, data_uri, or url_safe beyond the 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?

The first sentence gives a specific verb pair and resource: encode a local file's bytes to Base64 or decode a Base64 text file. It is immediately distinguishable from the sibling convert_text by operating on a path on disk rather than pasted text, and the title reinforces the same scope.

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?

It states the selecting condition explicitly ('when the data is in a file on this computer, so you don't have to paste it') and an exclusion with an alternative ('Files larger than 5 MB are rejected; use the Apify version for bigger jobs'). It also gives a precondition for the decode direction: the file must be UTF-8 text holding Base64 or a data URI, not binary.

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

Deploy Server

Other Tools