Skip to main content
Glama

update_supply

Update supply product details by specifying only the fields to change, using the declaration ID from declare_supply. Modify title, description, price, stock, and more.

Instructions

更新供给商品信息。只传需要改的字段。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
declaration_idYes商品 ID(declare_supply 返回)
titleNo新标题
descriptionNo新描述
category_l1No一级品类
category_l2No二级品类
priceNo新单价(分)
price_currencyNo币种
moqNo最小起订量
stock_quantityNo库存数量
delivery_daysNo交期(天)
service_regionsNo服务区域
keywordsNo搜索关键词

Implementation Reference

  • The handler for the 'update_supply' tool. Parses input with UpdateSupplySchema, extracts declaration_id, and calls client.updateSupply().
    case 'update_supply': {
      const p = S.UpdateSupplySchema.parse(args);
      const { declaration_id, ...updateData } = p;
      result = await client.updateSupply(declaration_id, updateData);
      break;
  • Zod schema for validating the 'update_supply' tool input. declaration_id is required; all other fields are optional.
    export const UpdateSupplySchema = z.object({
      declaration_id: z.number().int().positive(),
      title: z.string().optional(),
      description: z.string().optional(),
      category_l1: z.string().optional(),
      category_l2: z.string().optional(),
      price: z.number().positive().optional(),
      price_currency: z.string().optional(),
      moq: z.number().int().positive().optional(),
      stock_quantity: z.number().int().nonnegative().optional(),
      delivery_days: z.number().int().positive().optional(),
      service_regions: z.string().optional(),
      keywords: z.string().optional(),
    });
  • src/index.ts:136-139 (registration)
    'update_supply' is registered in the 'supply' group of the tool list.
    supply: [
      'declare_supply', 'update_supply', 'list_supply_products',
      'get_supply_product', 'delete_supply_product',
    ],
  • src/index.ts:529-549 (registration)
    Full tool registration metadata: name, description, and input JSON Schema for 'update_supply'.
    {
      name: 'update_supply',
      description: '更新供给商品信息。只传需要改的字段。',
      inputSchema: {
        type: 'object' as const,
        properties: {
          declaration_id: { type: 'number', description: '商品 ID(declare_supply 返回)' },
          title: { type: 'string', description: '新标题' },
          description: { type: 'string', description: '新描述' },
          category_l1: { type: 'string', description: '一级品类' },
          category_l2: { type: 'string', description: '二级品类' },
          price: { type: 'number', description: '新单价(分)' },
          price_currency: { type: 'string', description: '币种' },
          moq: { type: 'number', description: '最小起订量' },
          stock_quantity: { type: 'number', description: '库存数量' },
          delivery_days: { type: 'number', description: '交期(天)' },
          service_regions: { type: 'string', description: '服务区域' },
          keywords: { type: 'string', description: '搜索关键词' },
        },
        required: ['declaration_id'],
      },
  • The actual HTTP client method that sends a PUT request to /acap/v1/supply-products/{id} to update a supply product.
    async updateSupply(id: number, data: Record<string, any>) {
      return this.request('PUT', `/acap/v1/supply-products/${id}`, data);
    }
Behavior3/5

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

With no annotations, the description carries full responsibility. It discloses the partial update pattern but omits return value, error handling, or side effects. The hint is useful but not comprehensive.

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?

Two sentences, no extraneous words. Purpose and usage hint are front-loaded and efficient.

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?

Given 12 parameters and no output schema, the description covers the core behavioral pattern. It lacks details on return value or error scenarios, but is adequate for a simple update tool.

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%, but the description adds the crucial insight that only changed fields need to be sent, which goes beyond schema descriptions.

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 verb '更新' (update) and resource '供给商品信息' (supply product information), distinguishing it from sibling tools like declare_supply and delete_supply_product.

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 second sentence '只传需要改的字段' explicitly instructs to only pass fields that need changing, indicating partial update behavior. However, it does not provide explicit when-not-to-use or alternative tools.

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/ggqshuai-hub/a2amarket-mcp-server'

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