Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesAgent ID
preferred_categoriesNo偏好品类
preferred_regionsNo偏好地区
default_budget_maxNo默认预算上限
quality_levelNo质量偏好
negotiation_aggressionNo议价激进度 0.0~1.0
max_delivery_daysNo最大可接受交期(天)
auto_authorizeNo是否自动授权低于阈值的交易

Implementation Reference

  • 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);
    }
  • 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;
  • 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',
    ],
Behavior2/5

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

No annotations provided, so description must disclose behavior. It only notes that settings affect sourcing and negotiation and explains the negotiation_aggression range. It does not state that it writes data, requires certain permissions, or has persistent effects.

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 very short (two sentences) and to the point. No unnecessary words, but more information could be included without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 parameters and no output schema, the description lacks essential context: return value, failure modes, side effects, or any post-condition. It barely covers the tool's full behavior.

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 coverage is 100%, so baseline is 3. The description adds meaning only for negotiation_aggression (range 0.0~1.0). Other parameters rely solely on schema descriptions, which are present but not enhanced.

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 tool sets procurement preferences and mentions the effects on sourcing and negotiation. The verb 'set' matches the tool name, and the resource 'preferences' is unambiguous, distinguishing it from siblings like get_preferences.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. It does not mention prerequisites, when not to use, or refer to any related 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