360 Secure SkillHub
360 安全技能中心

Tencent Docs Stable Channel

核心功能:故障分类、token自检、一次重试后JSON-RPC直连兜底,长内容按段落分块(≤16KB)追加,写入后回读验证。典型场景:腾讯文档写入/上传/推送失败,连接器报无token/超时/初始化失败,或推送超8KB内容前。输出含故障处理方式、验证结果及文档链接的短报告。

haiyangchenbj
haiyangchenbj
热度 29.57
最近更新 2026-09-23 18:57:19
分类:开发依赖:MCP 服务 / 第三方 API / 读写文件 / 内部调用大模型应用场景:API 集成 / 自动化脚本 / 调试排错 / 工作流 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add tencent-docs-stable
Metadata
name
tencent-docs-stable
slug
tencent-docs-stable
displayName
Tencent Docs Stable Channel
version
1.0.2
description
Stable write path for Tencent Docs (腾讯文档) when the MCP connector fails. Use when any Tencent Docs write, upload, push, or paragraph insert fails or times out, when connector init reports no_token, or when long content truncates silently. Trigger keywords: tencent docs upload failed, tdoc_init no_token, 无token, 文档推送失败, 腾讯文档写入失败, 上传失败, connector timeout, insert paragraph failed, smart document push, 腾讯文档初始化失败, 内容被截断, 文档分块. Covers failure classification, token self-check, one retry then direct JSON-RPC fallback via runtime-resolved gateway config, 16KB chunking at paragraph boundaries, and read-back verification.
description_zh
腾讯文档写入通道稳定层:MCP 连接器失败(no_token / 超时 / 初始化失败)时的故障分类、token 自检、一次重试后 JSON-RPC 直连兜底(endpoint 运行时从配置解析,不硬编码),长内容 16KB 段落边界分块追加,写入后回读验证。
read_when
Any Tencent Docs (腾讯文档) write, upload, or push fails; connector reports no_token / timeout / init failure; or before pushing content longer than ~8KB through the connector.
not_for
["Reading local Office files (use tencent-local-office-edit / format-extract)","Converting HTML to DOCX (use html-to-docx)","Notion or other document platforms","Publishing to WeChat Official Account"]
agent_created
true

Tencent Docs Stable Channel

Purpose: make Tencent Docs writes survive connector failures. The MCP connector is the primary path; this skill defines a deterministic self-check sequence and a direct JSON-RPC fallback so a broken connector does not kill the task.

Workflow

  1. [Deterministic] Classify the failure from the error message: no_token / auth error / timeout / validation error / rate limit. Each class has a different remediation (see Failure Handling).
  2. [Deterministic] Token self-check: resolve credentials the way the connector documents them (config file, environment variable, or connector-managed store). Verify the source exists and is non-empty. Never print the token value.
  3. [Deterministic] Retry once after ~5 seconds with the identical call. Gateway blips are the most common transient cause; one retry resolves most of them.
  4. [LLM] Direct JSON-RPC fallback (only if the connector still fails after one retry):
    • Read the MCP server configuration at runtime to discover the gateway endpoint. Never hardcode host, port, or token in scripts or skill text.
    • Send JSON-RPC requests over HTTP: method = tool name, params = tool arguments, same schema the connector uses.
    • For content above ~16KB, split at paragraph boundaries into chunks of ≤16KB and append sequentially (create document → append chunk 1 → append chunk 2 → ...). Appending whole documents in one call silently truncates or fails validation.
  5. [Deterministic] Verify: read back the document title and first paragraph; confirm appended chunk count equals the number sent. Report the document link.

Hard Rules

  • Never print, log, or embed the token value anywhere.
  • Never hardcode gateway endpoint, port, or credentials — always resolve from config at runtime.
  • Exactly one retry before switching to fallback. No retry loops.
  • Chunk size ≤16KB, split at paragraph boundaries, never mid-paragraph.
  • After fallback, always verify by reading back, not by trusting the write response alone.

Failure Handling

  • no_token after self-check: report which credential source was checked and what was missing; stop. Do not invent a token.
  • Both connector and fallback fail (one attempt each): mark the target UNREACHABLE with both error messages as evidence; do not keep polling.
  • Validation error on content: check for unsupported HTML constructs (tables, nested lists, images with external hosts); degrade to plain paragraphs and retry once.
  • Rate limit: wait 60s, retry once, then stop.

Output Format

Short report: failure class → remediation used (retry / fallback) → verification result (title, paragraph count, chunk count) → document link.