Skip to main content
Glama
alttextai
by alttextai

Generate Alt Text from File

generate_alt_text_from_file

Generate alt text from a local image file. Reads the file, base64-encodes it, and sends it to AltText.ai, costing one credit.

Instructions

Generate alt text from a local image file. Reads the file, base64-encodes it, and sends it to AltText.ai. Costs 1 credit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNoComma-separated language codes (e.g. 'en', 'en,fr,es')
tagsNoTags for organization
asset_idNoCustom asset ID (default: auto-generated hash)
keywordsNoKeywords to incorporate
metadataNoCustom metadata (string key-value pairs)
file_pathYesAbsolute path to a local image file
max_charsNoMaximum character length for the alt text
overwriteNoOverwrite existing alt text if image was previously processed
gpt_promptNoCustom prompt template. Use {{AltText}} as a placeholder for the generated alt text.
negative_keywordsNoKeywords to avoid
Behavior3/5

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

No annotations exist, so the description must carry the full transparency burden. It discloses the external API call and credit cost, which is valuable. However, it omits whether the alt text is persisted to the service (suggested by parameters like overwrite and asset_id) or only returned, leaving a side-effect 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 a single, front-loaded sentence that captures the core purpose and a key cost detail. No redundant wording, very efficient.

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 10 parameters and no output schema, and the description is brief. While the schema is rich, the description does not clarify whether the generated alt text is saved or returned, which is a meaningful ambiguity given the persistence-related parameters. It is minimally adequate but incomplete.

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% and all parameters have detailed descriptions (e.g., file_path, lang, overwrite). The description adds no extra parameter semantics beyond what the schema already provides, so the baseline 3 applies.

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 action ('Generate alt text'), the specific input type ('local image file'), and the process ('Reads the file, base64-encodes it, and sends it to AltText.ai'), distinguishing it from sibling tools. It also adds a cost signal, making the purpose fully explicit.

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?

The description clearly implies the tool is for local files, which is a strong contextual cue against siblings like generate_alt_text. However, it does not explicitly state when not to use this tool or mention an alternative for remote images, so there is some room for ambiguity.

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/alttextai/alttext-mcp'

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