Skip to main content
Glama

Px Image Base64

px_image_base64

Returns PNG bytes as a base64 text field in JSON, preserving transparency and optional downscaling, so callers can decode and write the file themselves.

Instructions

Return a PNG file's bytes as a PLAIN TEXT base64 field in the JSON result ({"png_base64": "iVBORw0...", "mime": "image/png", "bytes": N, ...}) instead of an ImageContent block, so the caller can decode and write it themselves (e.g. into a sandboxed outputs directory). Transparency is preserved. max_side=0 keeps the original size; otherwise downscale before encoding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
max_sideNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It discloses the exact JSON shape, that transparency is preserved, that max_side=0 keeps the original size, and that larger values downscale before encoding. It does not mention error behavior or path validation, but for a read-only encoding operation this is adequate.

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?

Two sentences front-load the core output format, then justify why it exists and explain the only non-obvious parameter. Every sentence adds value, with no filler or repetition of the tool name.

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 simple two-parameter read tool with an output schema, the description covers output representation, purpose, and parameter behavior. The remaining omissions – explicit path documentation and edge-case handling – are minor and unlikely to block correct 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?

Schema description coverage is 0%, so the description compensates by fully explaining max_side semantics ('max_side=0 keeps the original size; otherwise downscale before encoding'). The path parameter is inferable as the PNG file path from the opening clause, though it is not explicitly described.

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 specifies a concrete verb ('Return'), resource ('a PNG file's bytes'), and distinguishes the output format ('as a PLAIN TEXT base64 field... instead of an ImageContent block'). This clearly separates it from image-viewing siblings like px_view_image or px_view_images.

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?

The phrase 'instead of an ImageContent block, so the caller can decode and write it themselves (e.g. into a sandboxed outputs directory)' gives an explicit use case and implicitly tells agents when to prefer this tool over display-oriented alternatives. It conveys both the purpose and the conditional in a compact way.

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