Skip to main content
Glama

查询库存

check_stock
Read-onlyIdempotent

Check product inventory by numeric product ID, optionally for a specific SKU, using storefront data that may not reflect real-time availability.

Instructions

按正整数商品 ID 查询库存,并可指定 SKU。结果转述店面接口,不一定等于实时可购数量。质保订阅,不保封号。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>"
    },
    "name": "check_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes商品数字 ID
sku_idNo可选,指定一个 SKU

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

The annotations already declare read-only, idempotent, and open-world behavior, so the description's main value is the warning that results are relayed from the storefront API and may not equal real-time purchasable quantity. It also adds a caveat about coverage for subscription purchases versus account bans, which is contextual behavior an agent would not get from the annotations alone.

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?

The description is three short clauses, and it leads with the lookup operation before the caveats. The final clause about subscription coverage and account bans is terse to the point of ambiguity and could be clearer.

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 simple two-parameter read-only lookup whose annotations already carry the safety profile and whose schema documents both parameters, the description covers the essentials and adds the important data-freshness caveat. The only gap is the missing explicit routing relative to sibling tools.

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%, so the schema already documents both id and sku_id, including that id is required and sku_id is optional. The description adds only the 'positive integer' framing, which the schema also enforces, so it does not meaningfully extend parameter semantics.

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 and resource (query stock / 查询库存) tied to a required product ID and optional SKU, which clearly separates it from siblings like get_product or search_products. It does not name any sibling, so the differentiation is inferable but not explicit.

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 usage context is implied: use it when you already have a product ID and want stock information. There is no explicit when-to-use or when-not-to-use guidance and no named alternative for cases such as looking up full product details.

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