Skip to main content
Glama

file_to_images

Convert markdown or text files into image cards for Xiaohongshu by extracting titles from headings, cleaning formatting, and offering themes, ratios, and AI covers.

Instructions

Convert a local markdown or text file to a series of images. Supports .md, .txt, .text files. Automatically extracts title from the first # heading in markdown files. Cleans up markdown formatting for cleaner text display.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratioNoImage aspect ratio3:4
themeNoVisual theme for the imagesminimal
titleNoOverride the auto-extracted title
filePathYesAbsolute path to the markdown or text file
fontSizeNoFont size for contentmedium
outputDirNoDirectory path to save generated images. If provided, images will be saved as PNG files.
showCoverNoWhether to generate a cover page (defaults to true for files)
charsPerPageNoCustom characters per page
generateAiCoverNoGenerate AI cover image using Gemini. Defaults to true if GEMINI_API_KEY is set. Set to false to disable.
Behavior3/5

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

With no annotations, the description carries the safety and behavior disclosure burden. It discloses input file types, markdown cleanup, and title extraction, but omits important runtime behavior such as what happens when outputDir is not provided (e.g., whether images are returned inline) and the potential side effect of writing PNG files. The mention of AI cover generation is absent, leaving a significant behavioral gap.

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?

The description is two sentences long, starts with the core purpose, and every sentence adds value. There is no redundancy or filler, making it highly scannable for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 9 parameters, no output schema, and no annotations, so the description should clarify the output contract. It fails to explain whether the function returns image data, file paths, or requires outputDir for persistence. While the schema covers parameter semantics, the overall usage contract is incomplete for an agent to confidently invoke the tool.

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 the baseline is 3. The description adds meaningful context to parameters: 'Automatically extracts title from the first # heading in markdown files' clarifies the default behavior of the title parameter, and 'Cleans up markdown formatting for cleaner text display' explains the conversion process. This goes beyond pure schema descriptions and raises the score.

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 opens with a specific verb and resource ('Convert a local markdown or text file to a series of images') and clearly distinguishes this file-based tool from the sibling text_to_images by emphasizing local file input and supported extensions (.md, .txt, .text). This makes the tool's scope and differentiation immediately evident.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (file input, markdown handling) but does not explicitly say when to choose this over alternatives like text_to_images or list_themes. It mentions auto-extraction of title from headings, which hints at markdown-centric usage, but offers no exclusions or when-not-to-use guidance.

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/dthinkr/xhs-image-mcp'

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