set_preferences
Set procurement preferences such as categories, regions, budget, quality, negotiation aggression, and delivery time to influence sourcing rankings and automated negotiation behavior.
Instructions
设置采购偏好。影响寻源排序和托管议价行为。negotiation_aggression: 0.0(保守)~1.0(激进)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID | |
| preferred_categories | No | 偏好品类 | |
| preferred_regions | No | 偏好地区 | |
| default_budget_max | No | 默认预算上限 | |
| quality_level | No | 质量偏好 | |
| negotiation_aggression | No | 议价激进度 0.0~1.0 | |
| max_delivery_days | No | 最大可接受交期(天) | |
| auto_authorize | No | 是否自动授权低于阈值的交易 |
Implementation Reference
- src/acap-client.ts:281-283 (handler)The actual HTTP handler that sends a POST request to set preferences for an agent via the ACAP API.
async setPreferences(agentId: string, preferences: Record<string, any>) { return this.request('POST', `/acap/v1/agents/${agentId}/preferences`, preferences); } - src/index.ts:942-946 (handler)The main tool handler that parses arguments with SetPreferencesSchema and calls client.setPreferences().
case 'set_preferences': { const p = S.SetPreferencesSchema.parse(args); const { agent_id, ...prefData } = p; result = await client.setPreferences(agent_id, prefData); break; - src/schemas.ts:65-74 (schema)Zod validation schema for set_preferences input, defining fields like agent_id, preferred_categories, preferred_regions, default_budget_max, quality_level, negotiation_aggression, max_delivery_days, auto_authorize.
export const SetPreferencesSchema = z.object({ agent_id: z.string().min(1), preferred_categories: z.array(z.string()).optional(), preferred_regions: z.array(z.string()).optional(), default_budget_max: z.number().positive().optional(), quality_level: z.enum(['economy', 'standard', 'premium']).optional(), negotiation_aggression: z.number().min(0).max(1).optional(), max_delivery_days: z.number().int().positive().optional(), auto_authorize: z.boolean().optional(), }); - src/index.ts:473-491 (registration)MCP tool registration with name 'set_preferences', description, and inputSchema (JSON Schema) defining all parameters.
// ═══ 买家 — 偏好设置 ═══ { name: 'set_preferences', description: '设置采购偏好。影响寻源排序和托管议价行为。negotiation_aggression: 0.0(保守)~1.0(激进)。', inputSchema: { type: 'object' as const, properties: { agent_id: { type: 'string', description: 'Agent ID' }, preferred_categories: { type: 'array', items: { type: 'string' }, description: '偏好品类' }, preferred_regions: { type: 'array', items: { type: 'string' }, description: '偏好地区' }, default_budget_max: { type: 'number', description: '默认预算上限' }, quality_level: { type: 'string', enum: ['economy', 'standard', 'premium'], description: '质量偏好' }, negotiation_aggression: { type: 'number', description: '议价激进度 0.0~1.0' }, max_delivery_days: { type: 'number', description: '最大可接受交期(天)' }, auto_authorize: { type: 'boolean', description: '是否自动授权低于阈值的交易' }, }, required: ['agent_id'], }, }, - src/index.ts:133-135 (registration)Tool listed under 'preferences' capability group in the capabilities/groupings section.
preferences: [ 'set_preferences', 'get_preferences', ],