declare_supply
Publish supply products by specifying title and price. Buyers automatically match your listings. Returns product_id. Supports optional fields like description, category, stock, and delivery.
Instructions
发布供给商品。买家寻源时会自动匹配你的商品。返回 product_id。title 和 price 必填,其余可选。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | 商品标题 | |
| description | No | 商品描述 | |
| category_l1 | No | 一级品类 | |
| category_l2 | No | 二级品类 | |
| price | Yes | 单价(单位:分) | |
| price_currency | No | 币种,默认 CNY | |
| moq | No | 最小起订量 | |
| stock_quantity | No | 库存数量 | |
| delivery_days | No | 交期(天) | |
| service_regions | No | 服务区域 | |
| image_url | No | 商品图片 URL | |
| keywords | No | 搜索关键词 | |
| contact_name | No | 联系人 | |
| contact_phone | No | 联系电话 |
Implementation Reference
- src/acap-client.ts:293-304 (handler)API client method that POSTs to /acap/v1/supply-products to declare a new supply product.
async declareSupply(data: { title: string; description?: string; category_l1?: string; category_l2?: string; price: number; price_currency?: string; moq?: number; stock_quantity?: number; delivery_days?: number; service_regions?: string; image_url?: string; keywords?: string; contact_name?: string; contact_phone?: string; extra_attrs?: Record<string, any>; expires_at?: string; }) { return this.request('POST', '/acap/v1/supply-products', data); } - src/index.ts:955-958 (handler)MCP tool handler: parses input with DeclareSupplySchema, calls client.declareSupply(), and returns result.
case 'declare_supply': { const p = S.DeclareSupplySchema.parse(args); result = await client.declareSupply(p); break; - src/schemas.ts:78-93 (schema)Zod validation schema for declare_supply tool input, defining all fields with types and constraints.
export const DeclareSupplySchema = z.object({ title: z.string().min(1), description: z.string().optional(), category_l1: z.string().optional(), category_l2: z.string().optional(), price: z.number().positive(), 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(), image_url: z.string().url().optional(), keywords: z.string().optional(), contact_name: z.string().optional(), contact_phone: z.string().optional(), }); - src/index.ts:504-528 (registration)MCP tool registration with name 'declare_supply', description, and JSON Schema input definition (title, price required).
// ═══ 卖家 — 供给管理 ═══ { name: 'declare_supply', description: '发布供给商品。买家寻源时会自动匹配你的商品。返回 product_id。title 和 price 必填,其余可选。', inputSchema: { type: 'object' as const, properties: { 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: '币种,默认 CNY' }, moq: { type: 'number', description: '最小起订量' }, stock_quantity: { type: 'number', description: '库存数量' }, delivery_days: { type: 'number', description: '交期(天)' }, service_regions: { type: 'string', description: '服务区域' }, image_url: { type: 'string', description: '商品图片 URL' }, keywords: { type: 'string', description: '搜索关键词' }, contact_name: { type: 'string', description: '联系人' }, contact_phone: { type: 'string', description: '联系电话' }, }, required: ['title', 'price'], }, }, - src/index.ts:136-139 (registration)Tool is listed under the 'supply' group in the tool category grouping.
supply: [ 'declare_supply', 'update_supply', 'list_supply_products', 'get_supply_product', 'delete_supply_product', ],