Skip to main content
Glama

TokenHub 文生图

tokenhub_generate_image

Generate images from text descriptions using the TokenHub API. Choose size, model, quality, and format to get image URLs or base64 data with token usage.

Instructions

调用 TokenHub 接口,根据文本描述同步生成图片(模型默认 custom-model-og-v2,需在 TokenHub 控制台开白并配置专属 API Key)。返回图片 URL 列表、request_id 与 token 用量。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo生成图片数量 1-10,默认 1
sizeNo生成尺寸 "宽x高",如 2048x2048。约束:单边≤3840px、宽高为 16 的倍数、长短边比≤3:1、总像素 655360~8294400
modelNo单次覆盖模型名。不传时用环境变量 TOKENHUB_MODEL(默认 custom-model-og-v2)
promptYes文本描述,最大 32000 字符
qualityNo画质,默认 auto
base_urlNo单次覆盖站点域名(如 https://tokenhub.tencentmaas.com)。不传时用环境变量 TOKENHUB_BASE_URL
backgroundNo图像背景透明度:opaque 不透明 / auto 自动判断,默认 auto
output_formatNo输出格式,默认 png
response_formatNo返回格式:url(图片地址)或 b64_json(base64 数据),默认 url
output_compressionNoJPEG 压缩级别 0-100,仅 output_format=jpeg 时生效
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the call is synchronous, requires the user to have whitelisted the model and configured a dedicated API key, and that the response includes image URLs, request_id, and token usage. It does not cover error behavior or rate limits, but the key behavioral constraints are present.

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 short, information-dense sentences with no redundancy. It ends with the action and auth prerequisite, then return values. Every word contributes to the agent's understanding.

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 tool with 10 parameters and no output schema, the description covers the important context: synchronous, auth required, default model, return shape. The schema covers parameter details, and what is missing (timeouts, error behavior) is minor for most use cases.

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?

The input schema documents all 10 parameters with detailed per-parameter descriptions, so the description adds very little for parameters. Mentioning the default model is useful but overlaps with the schema's model field. This is the expected baseline since schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action: calling TokenHub to synchronously generate an image from a text description, and identifies the resource (image). It does not explicitly contrast with tokenhub_edit_image, but the 'generate from text' wording is distinct enough.

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 the appropriate scenario (generate an image from a prompt) and provides essential prerequisites (whitelist + dedicated API key). However, it gives no explicit guidance on when to prefer this over tokenhub_edit_image or when not to use it.

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/willsygao/tokenhub-aigc-model'

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