Skip to main content
Glama

as__CreateScalingPolicy

Creates an auto scaling policy that defines alarm, scheduled, or recurring triggers and instance add/remove/reduce/set actions for a scaling group.

Instructions

[AS] 创建弹性伸缩策略。伸缩策略定义了伸缩组内实例的扩张和收缩操作。如果执行伸缩策略造成伸缩组期望实例数与伸缩组内实例数不符,弹性伸缩会自动调整实例资源,以匹配期望实例数。当前伸缩策略支持告警触发策略,周期触发策略,定时触发策略。在策略执行具体动作中,可设置实例变化的个数,或根据当前实例的百分比数进行伸缩。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>",
      "scaling_group_id": "<scaling_group_id>",
      "scaling_policy_name": "<scaling_policy_name>",
      "scaling_policy_type": "<scaling_policy_type>"
    },
    "name": "as__CreateScalingPolicy"
  }
}

Input Schema

NameRequiredDescriptionDefault
alarm_idNo告警ID,即告警规则的ID,当scaling_policy_type为ALARM时该项必选,此时scheduled_policy不生效。创建告警策略成功后,会自动为该告警ID对应的告警规则的alarm_actions字段增加类型为autoscaling的告警触发动作。告警ID通过查询云监控告警规则列表获取,详见《云监控API参考》的“查询告警规则列表”。
project_idYes租户标识
cool_down_timeNo冷却时间,取值范围0-86400,默认为300,单位是秒。
scaling_group_idYes伸缩组ID,通过查询弹性伸缩组列表获取,详见查询弹性伸缩组列表。
scheduled_policyNo定时、周期任务策略
scaling_policy_nameYes策略名称(1-64字符),可以用中文、字母、数字、下划线、中划线的组合。
scaling_policy_typeYes策略类型。告警策略:ALARM(与alarm_id对应);定时策略:SCHEDULED(与scheduled_policy对应);周期策略:RECURRENCE(与scheduled_policy对应)
scaling_policy_actionNo策略执行具体动作

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and it does disclose the key behavioral consequence: executing the policy reconciles desired vs. actual instance counts, and actions can scale by count or percentage. However, it omits permission requirements, side effects like automatically appending alarm_actions (only noted in the schema), and any error or limit conditions.

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 purpose is front-loaded and the text is a coherent, moderately sized paragraph. The explanatory sentences defining what a scaling policy is lean toward background filler, but they remain relevant and do not obscure the core action.

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?

For an 8-parameter create tool with nested objects and no output schema, the description conveys the operation's effect and the supported trigger modes, while the exhaustive schema covers field-level detail. Missing return/error behavior is a minor gap given the rich schema.

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 description coverage is 100%, so the schema already documents all parameters thoroughly, establishing a baseline of 3. The description adds the semantic that scaling actions operate either by instance number or by percentage of current instances, which mirrors but does not substantially extend the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource ('创建弹性伸缩策略') and explains what a scaling policy is, including the three supported trigger types (ALARM, RECURRENCE, SCHEDULED). It is clearly a create operation, but it does not differentiate itself from the sibling as__CreateScalingV2Policy or explain the V1/V2 distinction.

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

Usage Guidelines3/5

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

Usage is implied through the enumerated policy types, which map onto the scaling_policy_type enum, but there is no explicit when-to-use guidance and no comparison against alternatives such as CreateScalingV2Policy or UpdateScalingPolicy. An agent must infer which sibling applies.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools