Skip to main content
Glama

预估图片生成所需积分

estimate_credits

Estimate image generation credit costs by model, size, and aspect ratio before generating. Check costs for batch or 4K jobs without deducting credits.

Instructions

根据模型、尺寸、宽高比等参数预估生成图片所需的积分。同步返回,不实际生成图片、不扣除积分。适合在批量生成或使用 4K 前先确认成本。

Input Schema

NameRequiredDescriptionDefault
modelNo图片生成模型,默认 gemini-3-pro-image。选择建议:gemini-3-pro-image 综合最强、指令遵循和文字渲染好(15 积分/1K-2K);gemini-3.1-flash-image 快速便宜的日常生成(10 积分);gpt-image-2 性价比最高(4 积分起);gpt-image-2.5-flare 偏快速出图,gpt-image-2.5-sunburst 偏细节密集;两者同价,具体尺寸和积分先用 estimate_credits 查询;wan2.7-image-pro / wan2.7-image 写实与海报风格;seedream-5-0-pro 擅长精准局部编辑(配合参考图使用)
promptYes
imageConfigNo
referenceImagesNo图生图 / 改图的参考图片,支持 fileUri(gs:// 或 https://)或 base64 inlineData

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv2.2.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / imageConfig
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "aspectRatio": {
      +      "enum": [
      +        "1:1",
      +        "2:3",
      +        "3:2",
      +        "3:4",
      +        "4:3",
      +        "4:5",
      +        "5:4",
      +        "9:16",
      +        "16:9",
      +        "21:9",
      +        "1:4",
      +        "4:1",
      +        "1:8",
      +        "8:1"
      +      ],
      +      "type": "string"
      +    },
      +    "imageSize": {
      +      "enum": [
      +        "1K",
      +        "2K",
      +        "4K"
      +      ],
      +      "type": "string"
      +    },
      +    "quality": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / model
      Added value: +{
      +  "description": "图片生成模型,默认 gemini-3-pro-image。选择建议:gemini-3-pro-image 综合最强、指令遵循和文字渲染好(15 积分/1K-2K);gemini-3.1-flash-image 快速便宜的日常生成(10 积分);gpt-image-2 性价比最高(4 积分起);gpt-image-2.5-flare 偏快速出图,gpt-image-2.5-sunburst 偏细节密集;两者同价,具体尺寸和积分先用 estimate_credits 查询;wan2.7-image-pro / wan2.7-image 写实与海报风格;seedream-5-0-pro 擅长精准局部编辑(配合参考图使用)",
      +  "enum": [
      +    "gemini-3-pro-image",
      +    "gemini-3.1-flash-image",
      +    "gpt-image-2",
      +    "gpt-image-2.5-flare",
      +    "gpt-image-2.5-sunburst",
      +    "wan2.7-image-pro",
      +    "wan2.7-image",
      +    "seedream-5-0-pro"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / prompt
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / referenceImages
      Added value: +{
      +  "description": "图生图 / 改图的参考图片,支持 fileUri(gs:// 或 https://)或 base64 inlineData",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "fileData": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "fileUri": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "mimeType": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "fileUri"
      +        ],
      +        "type": "object"
      +      },
      +      "inlineData": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "data": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "mimeType": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "data"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "maxItems": 14,
      +  "type": "array"
      +}
    • addedInput schema / required
      Added value: +[
      +  "prompt"
      +]
  2. First observedv1.0.0

TDQS

A3.9/5.0
Behavior3/5

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

没有注解,因此描述承担全部说明责任;它很好地说明了关键的无副作用特性(同步返回、不实际生成、不扣费)。但它没有提及什么都不返回、是否校验参数,或者 estimate 与 generate 的校验是否不同。

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?

两句话,句句有分量,先说明“做什么”和“不做什么”。大小合适。“等参数”的措辞略含糊,但影响不大。

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?

对于一个包含嵌套对象的 4 参数估算工具,安全特性和使用时机都已覆盖,但描述从未说明返回值的形态(例如返回单个积分总数,还是按模型/尺寸拆分的明细),也没有输出 schema 来弥补这一点。

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 覆盖率为 50%;描述将参数概括为“模型、尺寸、宽高比”,但模型枚举的 schema 已经通过按模型给出积分成本和选型建议承担了大部分工作。描述从未说明为什么一个不生成内容的工具必须填写 prompt——这是 Agent 会注意到的实际缺口。

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?

特定动词(预估)+ 特定资源(生成图片所需的积分),并明确排除了实际生成(“不实际生成图片、不扣除积分”),从而与 generate_image 区分开来。Agent 无需查看 schema 即可知道此工具返回什么。

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?

“适合在批量生成或使用 4K 前先确认成本”给出了具体的使用场景,模型参数的 schema 也指引 Agent“先用 estimate_credits 查询”。它没有明确点出生成对应的操作(generate_image),但排除性陈述传达了这层意思。

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.