Skip to main content
Glama

das__ChangeSqlSwitch

Toggles DAS full SQL or slow query log collection on or off for a database instance, with optional retention days to control automatic data deletion.

Instructions

[DAS] 打开或者关闭DAS收集全量SQL开关,开启后,实例的性能损耗在5%以内。开启全量SQL后,本服务会对SQL的文本内容进行存储,以便进行分析。用户可自行设置全量SQL的保存时间范围,到期后会自动删除;如果未设置,数据默认保留7天。

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": {
      "datastore_type": "<datastore_type>",
      "instance_id": "<instance_id>",
      "project_id": "<project_id>",
      "status": "<status>",
      "type": "<type>"
    },
    "name": "das__ChangeSqlSwitch"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYes开关类型。取值DAS SQL Explorer和DAS Slow Query Log,分别表示DAS收集全量SQL开关和DAS收集慢SQL开关。
statusYes开关状态,取值0和1,分别代表要关闭和开启。
project_idYes项目ID
instance_idYes实例ID
datastore_typeYes数据库类型。当前全量SQL支持的数据库类型包括MySQL和GaussDB(for MySQL),慢SQL支持的类型:MySQL、GaussDB(for MySQL)、PostgreSQL。
retention_daysNoSQL数据保存时长(天)。默认为7天,最长可保留30天,到期后数据自动删除。如果要保留30天以上,请到DAS页面进行操作。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

B3.4/5.0
Behavior4/5

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

With no annotations, the description carries the whole burden and does a decent job: it discloses the ≤5% instance performance cost, that SQL text is stored for analysis, that retention is user-configurable, and that data is auto-deleted at expiry with a 7-day default. It omits what happens to previously collected data or in-flight jobs when the switch is turned off.

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?

Opens with the action and resource, then layers on cost and retention caveats in a logical order. The retention sentences are somewhat redundant with the schema but not wasteful enough to obscure the core message.

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

Completeness3/5

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

For a 6-parameter mutation tool with no annotations and no output schema, the definition covers cost and data-lifecycle side effects well. It nevertheless leaves the agent guessing about the slow-SQL mode, permission requirements, and the effect of disabling collection, which are exactly the gaps the description should close.

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 every parameter is already documented in the input schema, making 3 the baseline. The description's retention remarks echo what the schema already states and add no new meaning, and it says nothing about the `type` or `status` values beyond restating intent.

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?

Names a specific verb (turn on/off) and resource (the DAS full SQL collection switch), which is enough to distinguish it from status-read siblings like ShowSqlSwitchStatus. However, it describes only the full-SQL case while the schema's `type` parameter also supports the slow-SQL switch, so the stated purpose is narrower than the tool's actual scope.

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?

There is no guidance on when to call this versus the sibling switch tools (ChangeSqlLimitSwitchStatus, ChangeTransactionSwitchStatus) or whether to query current state first with ShowSqlSwitchStatus. The reader has to infer usage entirely from the name and parameters.

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