Skip to main content
Glama
Jambozx

OnlineCyberTools MCP (280+ filterable tools)

webdev_base64_image_encoder

Read-onlyIdempotent

Encode an image as base64, detect its real MIME type and pixel dimensions, and generate ready-to-paste embed snippets for HTML, CSS, JavaScript, and JSON.

Instructions

Base64 Image Encoder With Code Snippets. Decode a base64-encoded image, sniff its real MIME type and pixel dimensions from the file header (PNG, JPEG, GIF, WebP), and emit ready-to-paste embed snippets: raw base64, a data URI, CSS background rules, HTML img/inline-style tags, a JavaScript variable, and a JSON descriptor. Pass the image bytes as base64 in the fileData field (a full data:...;base64,... URI is also accepted and stripped). Use this when you want embeddable code for a raster image; use webdev_data_uri_generator to turn arbitrary text/SVG/MIME content into a data URI without image-dimension detection, or file_base64_file_encoder to base64-encode a non-image file. Runs locally on the data you provide: read-only, non-destructive, contacts no external service, and is rate-limited. Returns detected MIME type, width, height, byte sizes, the base64 string, and a keyed set of code snippets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileDataYesThe image as base64. A bare base64 payload or a full data:<mime>;base64,<...> URI is accepted; the prefix and whitespace are stripped. Must decode to a PNG, JPEG, GIF, or WebP; invalid or non-image data returns HTTP 400.
fileNameNoBase name used in the generated snippets (CSS class, img alt, JS variable). Non-alphanumeric characters become hyphens. Defaults to image.
fileTypeNoMIME type to write into the data URI, e.g. image/png. Defaults to the MIME detected from the file header.
includeDataUriNoInclude the full data-URI output entry. Defaults to true.
includeMimeTypeNoRetained in the echoed options. Defaults to true.
formatNoSnippet preference echoed back in options. Defaults to inline.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
originalFileNameNoSanitized base name used in the snippets.
detectedMimeTypeNoMIME type sniffed from the file header (image/png, image/jpeg, image/gif, image/webp).
imageWidthNoImage width in pixels, read from the header.
imageHeightNoImage height in pixels, read from the header.
originalSizeNoDecoded image size in bytes.
base64SizeNoLength of the base64 string in characters.
base64DataNoNormalized raw base64 (no data-URI prefix, no whitespace).
outputsNoKeyed code snippets (base64, dataUri, css, cssComplete, htmlImg, htmlInline, javascript, json); each value has title, description, and content strings.
optionsNoEchoed request options: includeDataUri, includeMimeType, format.
errorNoPresent instead of the above when input is invalid or not a supported image.
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds that it runs locally, is read-only, non-destructive, contacts no external service, and is rate-limited, providing useful behavioral context beyond annotations.

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?

Description is informative but not overly verbose; three sentences cover purpose, usage, and output. Slightly long but each sentence is valuable.

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?

Given the tool's complexity (6 params, output schema), the description covers purpose, guidelines, behavior, and return value (detected MIME, dimensions, snippets). No gaps.

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 has 100% coverage with descriptions for all 6 parameters. Description provides slight additional context (e.g., accepting full data URI, default fileName), but baseline is 3 due to high schema coverage.

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 clearly states the tool encodes base64 images, sniffs MIME type and dimensions, and emits code snippets. It explicitly distinguishes from siblings like webdev_data_uri_generator and file_base64_file_encoder.

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?

Provides explicit guidance on when to use (embeddable code for raster images) and when not (use webdev_data_uri_generator for text/SVG, file_base64_file_encoder for non-image files).

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/Jambozx/onlinecybertools-mcp-server'

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