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
- [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). - [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.
- [Deterministic] Retry once after ~5 seconds with the identical call. Gateway blips are the most common transient cause; one retry resolves most of them.
- [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.
- [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_tokenafter 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.
