Skip to main content
Glama
OmniQQ-MCP

OmniQQ-MCP

by haoan33

switch_qq_account

Idempotent

Hot-swap between locally saved QQ accounts without rescanning a QR code, and update the default account, OneBot port, and per-account message cache.

Instructions

在本地已保存登录凭证的多个 QQ 账号之间免扫码热切换,自动更新默认账号、OneBot 端口配置及按账号隔离的消息缓存池。 适用场景:目标 QQ 号此前已在本地扫码登录过(可通过 check_napcat_environment 的 cached_accounts 查看),需快速切换上线时调用。不适用与替代:若目标是一个从未登录过的新 QQ 号或登录凭证已失效,请勿使用本工具,应改用 login_new_qq_by_qrcode 扫码登录。 参数约束与交互:uin 必须为 5~11 位纯数字字符串;当 restart_immediately=True 时会立即终止旧账号进程并等待最多 wait_seconds 秒直至新账号端口就绪,为 False 时仅修改配置待下次启动生效。 行为与返回:幂等配置变更与进程重启操作(仅限本地运行时,外部 URL 返回失败);返回 status、switched_to、online_account 与 available_accounts。

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": {
      "uin": "<uin>"
    },
    "name": "switch_qq_account"
  }
}

Input Schema

NameRequiredDescriptionDefault
uinYes要切换上线的目标 QQ 号(5~11 位纯数字字符串,须已存在于本地缓存账号列表中)
wait_secondsNo当 restart_immediately=True 时等待新账号 OneBot 端口监听就绪的超时秒数(建议 15~60),默认 25
restart_immediatelyNo为 True 时立即终止旧进程并以新账号重启上线;为 False 时仅更新默认配置不中断当前进程,默认 True

Output Schema

NameRequiredDescriptionDefault
dataNo接口返回的业务负载数据(对象或数组,具体字段依工具而定)
statusNo执行状态标识,成功为 'ok'(或特定生命周期状态),失败为 'failed' 或 'error'
messageNo状态说明或错误诊断详情
retcodeNoOneBot 11 响应状态码,0 表示成功,非 0 表示协议端或网络错误

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.2.2
    • changedInput schema / properties / restart_immediately / description
      Previous value: -"是否立即重启 NapCat 服务使新账号即刻上线,默认 True"New value: +"为 True 时立即终止旧进程并以新账号重启上线;为 False 时仅更新默认配置不中断当前进程,默认 True"
    • changedInput schema / properties / uin / description
      Previous value: -"要切换的目标 QQ 号"New value: +"要切换上线的目标 QQ 号(5~11 位纯数字字符串,须已存在于本地缓存账号列表中)"
    • changedInput schema / properties / wait_seconds / description
      Previous value: -"重启时等待端口就绪的最大秒数,默认 25"New value: +"当 restart_immediately=True 时等待新账号 OneBot 端口监听就绪的超时秒数(建议 15~60),默认 25"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "data": {
      +      "description": "接口返回的业务负载数据(对象或数组,具体字段依工具而定)"
      +    },
      +    "message": {
      +      "description": "状态说明或错误诊断详情",
      +      "type": "string"
      +    },
      +    "retcode": {
      +      "description": "OneBot 11 响应状态码,0 表示成功,非 0 表示协议端或网络错误",
      +      "type": "integer"
      +    },
      +    "status": {
      +      "description": "执行状态标识,成功为 'ok'(或特定生命周期状态),失败为 'failed' 或 'error'",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed1 schema field changedv1.1.0
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that restart_immediately=True terminates the old account process and blocks up to wait_seconds for the new port to become ready, that False is a config-only change deferred to next start, and that the tool only works against a local runtime (external URLs return failure). Note a mild tension worth flagging: the description admits process termination while destructiveHint=false, though that hint conventionally covers data destruction rather than process restarts.

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?

Front-loaded with the core action, then cleanly sectioned into 适用场景 / 不适用与替代 / 参数约束 / 行为与返回. Dense and useful, though the closing enumeration of return fields (status, switched_to, online_account, available_accounts) is redundant given an output schema exists.

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

Completeness5/5

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

For a 3-parameter tool with an output schema, the description covers preconditions, the alternative path, side effects on process state, and failure modes (external URL). Nothing an agent needs in order to decide and invoke correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine value by explaining the coupling between restart_immediately and wait_seconds (the timeout only matters when an immediate restart happens) and restating the uin format constraint in the context of the cached-account requirement. The gain over the schema is real but modest since each parameter is already documented.

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?

States a specific verb and resource: hot-switching between locally cached QQ accounts without a QR scan, and enumerates the side effects (default account, OneBot port config, per-account message cache pool). This is immediately distinguishable from login_new_qq_by_qrcode and list_qq_accounts among the siblings.

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

Usage Guidelines5/5

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

Explicitly names the precondition (target uin must already exist in the local cached account list, discoverable via check_napcat_environment's cached_accounts) and an explicit exclusion with the named alternative: for a never-logged-in or expired-credential account, use login_new_qq_by_qrcode instead. Both when-to-use and when-not-to-use are covered.

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