set_hosted_strategy
Define hosted auto-response strategies for procurement intents. Set fixed price (cents) or budget ratio (0.0-1.0) to automatically quote on matching categories and budget filters.
Instructions
设置托管自动响应策略。有匹配意图时平台按此策略自动报价。auto_price: 固定报价(分); auto_price_ratio: 按买家预算百分比(如 0.85 = 85%)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strategy_name | No | 策略名称 | |
| category_l1 | Yes | 匹配品类(一级,必填) | |
| category_l2 | No | 匹配品类(二级) | |
| min_budget | No | 最低预算过滤 | |
| max_budget | No | 最高预算过滤 | |
| auto_price | No | 固定报价(分) | |
| auto_price_ratio | No | 按预算比例报价(0.0~1.0) | |
| auto_quantity | No | 可供数量 | |
| auto_delivery_days | No | 交货天数 | |
| auto_message | No | 自动附言模板 | |
| auto_respond | No | 是否自动响应(默认 true) |
Implementation Reference
- src/schemas.ts:131-143 (schema)Zod validation schema for 'set_hosted_strategy' input. Defines optional and required fields with constraints.
export const SetHostedStrategySchema = z.object({ strategy_name: z.string().optional(), category_l1: z.string().min(1, 'category_l1 为必填项'), category_l2: z.string().optional(), min_budget: z.number().nonnegative().optional(), max_budget: z.number().positive().optional(), auto_price: z.number().positive().optional(), auto_price_ratio: z.number().min(0).max(1).optional(), auto_quantity: z.number().int().positive().optional(), auto_delivery_days: z.number().int().positive().optional(), auto_message: z.string().optional(), auto_respond: z.boolean().optional(), }); - src/acap-client.ts:358-366 (helper)Low-level API client method that sends a POST request to /acap/v1/hosted/strategies with the strategy data.
async setHostedStrategy(data: { strategy_name?: string; category_l1: string; category_l2?: string; min_budget?: number; max_budget?: number; auto_price?: number; auto_price_ratio?: number; auto_quantity?: number; auto_delivery_days?: number; auto_message?: string; auto_respond?: boolean; }) { return this.request('POST', '/acap/v1/hosted/strategies', data); } - src/index.ts:638-659 (registration)Tool registration entry in the MCP tool list. Defines name, description, and JSON Schema inputSchema for the 'set_hosted_strategy' tool.
// ═══ 卖家 — 托管议价策略 ═══ { name: 'set_hosted_strategy', description: '设置托管自动响应策略。有匹配意图时平台按此策略自动报价。auto_price: 固定报价(分); auto_price_ratio: 按买家预算百分比(如 0.85 = 85%)。', inputSchema: { type: 'object' as const, properties: { strategy_name: { type: 'string', description: '策略名称' }, category_l1: { type: 'string', description: '匹配品类(一级,必填)' }, category_l2: { type: 'string', description: '匹配品类(二级)' }, min_budget: { type: 'number', description: '最低预算过滤' }, max_budget: { type: 'number', description: '最高预算过滤' }, auto_price: { type: 'number', description: '固定报价(分)' }, auto_price_ratio: { type: 'number', description: '按预算比例报价(0.0~1.0)' }, auto_quantity: { type: 'number', description: '可供数量' }, auto_delivery_days: { type: 'number', description: '交货天数' }, auto_message: { type: 'string', description: '自动附言模板' }, auto_respond: { type: 'boolean', description: '是否自动响应(默认 true)' }, }, required: ['category_l1'], }, }, - src/index.ts:1006-1011 (handler)Handler case for 'set_hosted_strategy'. Parses args with SetHostedStrategySchema, then calls client.setHostedStrategy(p).
// ── 卖家 — 托管议价策略 ── case 'set_hosted_strategy': { const p = S.SetHostedStrategySchema.parse(args); result = await client.setHostedStrategy(p); break; } - src/index.ts:147-149 (registration)Groups 'set_hosted_strategy' under the 'hosted_strategy' capability category.
hosted_strategy: [ 'set_hosted_strategy', 'list_hosted_strategies', 'delete_hosted_strategy', ],