Skip to main content
Glama

短.在线

Batch shorten · 批量短链(短.在线)

shorten_urls
Idempotent

一次同步创建 1 到 100 条短链。按 client_ref 对应结果,允许部分成功。需要已注册账户。批量重试只有三种情况,不要混用。示例:key 为 batch-1,两项 client_ref 分别为 notes(https://example.com/notes)和 draft(https://example.com/draft)。notes 成功,draft 的 retryable 为 true。(1) 传输结果不确定(没有拿到已完成的响应、IDEMPOTENCY_IN_PROGRESS、幂等锁不可用,或因瞬时数据库错误且一条都未创建而返回 503):用同一个 key 原样重发整批。已完成的批次返回已保存的结果,notes 不会再次创建。key 已被释放时,同一批会重新执行。(2) 已完成且某项 retryable 为 true:重放 batch-1 只返回已保存的结果,不会重试 draft。只用新 key(例如 batch-1-draft)发送 draft,并保留 client_ref draft,不要带上 notes。去掉 notes 后仍用 batch-1 会返回 IDEMPOTENCY_CONFLICT。(3) 校验错误:改正请求,不要把同一份无效请求当作网络重试。key 尚未保存的 400(重复 client_ref、缺少 items、BATCH_TOO_LARGE)改正后可以继续用同一个 key。已完成且 retryable 为 false 的项已保存;改正文后用原 key 会返回 IDEMPOTENCY_CONFLICT,改正后的项必须用新 key。 Create 1 to 100 short links in one synchronous request. Match each result by client_ref. Partial success is allowed. A registered account is required. Batch retry has three cases; do not mix them. Worked example: key batch-1 with client_ref notes (https://example.com/notes) and draft (https://example.com/draft). notes succeeds and draft is retryable true. (1) Uncertain transport outcome — no completed body, IDEMPOTENCY_IN_PROGRESS, an unavailable idempotency lock, or 503 because a transient database error created nothing: resend the entire unchanged batch with the same key. A completed batch returns the stored result and notes is not created again. A released key runs that same batch again. (2) Completed batch with retryable true: replaying batch-1 returns the stored body and does not retry draft. Send only draft, keeping client_ref draft, under a new key such as batch-1-draft. Do not include notes. Dropping notes and reusing batch-1 returns IDEMPOTENCY_CONFLICT. (3) Validation error: fix the request. Do not resend the same invalid body as a network retry. A 400 before the key is stored (duplicate client_ref, missing items, BATCH_TOO_LARGE) may reuse the key after the body is corrected. A completed item with retryable false is stored; a changed body on that key returns IDEMPOTENCY_CONFLICT, so send the corrected item with a new key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesSynchronous batch items (1 to 100). Each item creates one short link.
idempotency_keyYesClient-generated unique key for this create. Required. Replays within 24h.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • addedOutput schema / oneOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "batch_id": {
      +        "type": "string"
      +      },
      +      "batch_mode": {
      +        "const": "sync",
      +        "type": "string"
      +      },
      +      "fail_count": {
      +        "type": "number"
      +      },
      +      "ok": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "ok_count": {
      +        "type": "number"
      +      },
      +      "request_id": {
      +        "type": "string"
      +      },
      +      "results": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "client_ref": {
      +              "type": "string"
      +            },
      +            "ok": {
      +              "type": "boolean"
      +            },
      +            "problem": {
      +              "additionalProperties": {},
      +              "propertyNames": {
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "result": {
      +              "additionalProperties": {},
      +              "propertyNames": {
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "retryable": {
      +              "type": "boolean"
      +            }
      +          },
      +          "required": [
      +            "client_ref",
      +            "ok"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "request_id",
      +      "batch_id",
      +      "batch_mode",
      +      "ok_count",
      +      "fail_count",
      +      "results"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": false,
      +        "type": "boolean"
      +      },
      +      "request_id": {
      +        "type": "string"
      +      },
      +      "resend_path": {
      +        "description": "Where to resend the verification email when verification would raise this account's limits.",
      +        "type": "string"
      +      },
      +      "retryable": {
      +        "type": "boolean"
      +      },
      +      "title": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "request_id",
      +      "error",
      +      "code",
      +      "message",
      +      "type",
      +      "title",
      +      "retryable"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "ok": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "request_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "request_id"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties
      Removed value: -{
      -  "batch_id": {
      -    "type": "string"
      -  },
      -  "batch_mode": {
      -    "const": "sync",
      -    "type": "string"
      -  },
      -  "code": {
      -    "type": "string"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "fail_count": {
      -    "type": "number"
      -  },
      -  "message": {
      -    "type": "string"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  },
      -  "ok_count": {
      -    "type": "number"
      -  },
      -  "request_id": {
      -    "type": "string"
      -  },
      -  "resend_path": {
      -    "description": "Where to resend the verification email when verification would raise this account's limits.",
      -    "type": "string"
      -  },
      -  "results": {
      -    "items": {
      -      "additionalProperties": {},
      -      "propertyNames": {
      -        "type": "string"
      -      },
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "retryable": {
      -    "type": "boolean"
      -  },
      -  "title": {
      -    "type": "string"
      -  },
      -  "type": {
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok",
      -  "request_id"
      -]
  2. Changed3 schema fields changed
    • addedOutput schema / properties / resend_path
      Added value: +{
      +  "description": "Where to resend the verification email when verification would raise this account's limits.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / title
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / type
      Added value: +{
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / items / items / properties / locale / description
      Previous value: -"Accepted values: en, zh-CN, and zh-cn (the only case fold of zh-CN). EN, ZH-CN, and bare zh are rejected. Omitted or blank defaults to en."New value: +"API language preference. Canonical values: en and zh-CN. Documented aliases normalized to the canonical value: zh-cn, zh-Hans, zh-hans, zh_Hans, zh_hans. Traditional Chinese is not supported. EN, ZH-CN, and bare zh are rejected. Omitted or blank defaults to en. This preference does not rewrite URL bytes, translate parameter names, or use the caller's location. Website routes stay /zh-cn."
  4. Changed4 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "idempotency_key": "example-batch-1",
      +    "items": [
      +      {
      +        "alias": "notes",
      +        "client_ref": "item-1",
      +        "locale": "zh-cn",
      +        "title": "Notes",
      +        "url": "https://example.com/notes"
      +      }
      +    ]
      +  }
      +]
    • addedInput schema / properties / items / description
      Added value: +"Synchronous batch items (1 to 100). Each item creates one short link."
    • addedInput schema / properties / items / items / properties / locale / description
      Added value: +"Accepted values: en, zh-CN, and zh-cn (the only case fold of zh-CN). EN, ZH-CN, and bare zh are rejected. Omitted or blank defaults to en."
    • addedInput schema / properties / items / items / properties / title / description
      Added value: +"Optional link title, at most 256 characters."
  5. Changed8 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Idempotency key (same semantics as REST Idempotency-Key header)"New value: +"Client-generated unique key for this create. Required. Replays within 24h."
    • changedInput schema / properties / items / items / properties / alias / description
      Previous value: -"Optional ASCII alias [A-Za-z0-9_-], stored lowercase"New value: +"Optional custom path segment (stored lowercase). Do not send customSlug."
    • addedInput schema / properties / items / items / properties / client_ref / description
      Added value: +"Batch item correlation id (never use array index)."
    • removedInput schema / properties / items / items / properties / customSlug
      Removed value: -{
      -  "description": "Optional ASCII alias [A-Za-z0-9_-], stored lowercase",
      -  "maxLength": 32,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / items / items / properties / longUrl
      Removed value: -{
      -  "description": "http(s) destination URL — Soft C SSRF no-fetch applies",
      -  "maxLength": 2048,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • changedInput schema / properties / items / items / properties / url / description
      Previous value: -"http(s) destination URL — Soft C SSRF no-fetch applies"New value: +"Destination HTTPS/HTTP URL to shorten. Required. Do not send longUrl."
    • changedInput schema / properties / items / items / required
      Previous value: -[
      -  "client_ref"
      -]New value: +[
      +  "client_ref",
      +  "url"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "items"
      -]New value: +[
      +  "items",
      +  "idempotency_key"
      +]
  6. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true and readOnlyHint=false, but the description goes far beyond them: partial success allowed, same-key replay returns stored results, key release re-runs the batch, IDEMPOTENCY_CONFLICT triggers, and 24h replay window. This is exactly the behavioral context an agent needs for a write tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Content is front-loaded correctly (purpose, then example, then the three cases), and the retry detail earns its place given the idempotency complexity. But the entire body is duplicated in Chinese and English, roughly doubling token cost without adding information.

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

Completeness5/5

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

With an output schema present, return values need not be described, and the description covers auth requirement, partial success, correlation, and all retry paths. An agent has everything needed to call this correctly.

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, but the description adds real meaning: results are correlated by client_ref, and the worked example binds client_ref, idempotency_key, and retry behavior together in a way the schema does not.

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 states a specific verb+resource+scope: 'Create 1 to 100 short links in one synchronous request,' plus partial-success and client_ref matching semantics. This distinguishes it from the single-link sibling shorten_url by batch scope, though it never names that alternative explicitly.

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?

It gives rich conditional guidance for the three idempotency retry cases and states the prerequisite 'A registered account is required.' However, it never tells the agent when to pick this tool over shorten_url (one URL) versus the batch version, leaving the sibling choice to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources