Channel Publish channel-publish

Publish content to the user's bound Channel Accounts, schedule or change Publish At, cancel an unfinished Publish Task, or update already published content.

Use it when the user wants to post, schedule, cancel, or update social content on a connected platform.

Works in Claude, ChatGPT, Codex and more
Our test
—
not tested yet
GitHub stars
29k
yikart/aitoearn
Added by
0
members
Updated
Dec 6
commit 5c32758
Content
1 file
no scripts · 9 KB
License
MIT
free to use

What our test found

Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.

View on GitHub ↗
name: channel-publish
description: Publish content to the user's bound Channel Accounts, schedule or change Publish At, cancel an unfinished Publish Task, or update already published content. Use when the user wants to post, schedule, cancel, or update social content on a connected platform.
allowed-tools:
  - list_channel_accounts
  - list_channel_platforms
  - get_channel_platform
  - get_channel_publish_record

Channel Publish

Publish through Channel Accounts. Limits come from get_channel_platform, not from this file.

Environment

Some domestic platforms are not available on this edition — treat list_channel_platforms as the source of truth and never promise an unlisted platform. When the user asks to publish to a platform that is not listed, say it is not supported here and guide them to the domestic edition.

Tools

  • list_channel_accounts / get_channel_account: find the target account and its current status before server-side publishing.
  • list_channel_platforms: check which platforms support server-side publishing and discover their assembled tool IDs.
  • get_channel_platform: read the platform rules and available modes before preparing content. An instruction to use a browser extension means server-side publishing is unavailable for that platform.
  • list_channel_publish_records / get_channel_publish_record: inspect flows and tasks. Use flowId / taskId to get ChannelPublishRecord.id(recordId) when you need a recordId.
  • extract_video_frame: extract a single frame from a video (videoUrl, optional timeInSeconds, default 2s) and upload it as a cover image. Returns { coverUrl }. Use it before plugin publish when the platform requires a cover for video content (e.g. xhs video notes, coverRequired); you may pass the returned coverUrl to generate_image as a reference to design a styled cover first.
  • probe_video_metadata / probe_audio_metadata / probe_image_metadata (auxiliary): probe a media URL's duration / resolution / size to pre-check material against the get_channel_platform limits before creating a publish flow — fewer success:false validation round-trips. Each probe is billed per call; video/audio probes are async, so wait for the result and do not probe the same URL twice.
  • get_channel_publish_user_action: Douyin WaitingForUserAction only. Input is recordId only — resolve it via get_channel_publish_record { flowId | taskId } first. Output contains shareId/schemeUrl/shortLink/expiresAt/qrImageUrl(httpUrl); qrImageUrl is an httpUrl produced by agent-side qrcode + AssetsService.uploadFromBuffer, frontend renders it. Do NOT use raw qrText.
  • publish_channel_task_now / update_channel_publish_at / cancel_channel_publish_task / request_channel_publish_update: task commands. Search them when needed.

Do not invent platform limits. Do not dump option schema into the user reply.

Publish modes

  • Platforms with publish modes (e.g. Facebook, Instagram) expose one create tool per mode: create_{slug}_{mode}_publish_flow (e.g. create_facebook_post_publish_flow / create_facebook_reel_publish_flow / create_facebook_story_publish_flow). The mode option field (e.g. content_category) is filled by the tool automatically — never pass it yourself.
  • Pick the tool that matches the media type: video content → the video/reel mode tool; image or text content → the post/image mode tool. get_channel_platform lists each mode's limits and create tool id under ## 发布模式 / ## 工具.
  • If a create tool fails with a validation error indicating the media type does not match the publish mode, retry with the matching publish mode's create tool (corrected-parameter retries are fine; unchanged retries are not).

AI content label

When publishing AI-generated media, default to declaring it via the platform's AI label option; omit it only when the user explicitly says not to label it. It is an optional option field on the create tool: is_ai_generated (Facebook, reel mode only), is_aigc (TikTok), made_with_ai (Twitter), containsSyntheticMedia (YouTube). Platforms or modes without such a field simply do not send one.

Topics and body

  • create_*_publish_flow tools have no `topics` field. Topics are carried only as #hashtag inside body. Server extracts them via /#([\w\p{Script=Han}]+)/gu (parseTopicsFromBody) and for nativeField:true platforms strips them from body (stripTopicsFromBody) into the native topic field.
  • When get_channel_platform shows ## 话题 as “支持话题”: if the user gave topics (list or “带上 #AI”), normalize each to # + trimmed non-empty tag, dedupe, and insert into `body` as `#hashtag` (e.g. 正文 #AI #旅行 or inline within the body). If no topics were given, do not invent any. Respect maxCount / maxTotalLength — truncate or ask the user to choose. request_channel_publish_update follows the same rule.
  • When ## 话题 says “不要带话题”: do not insert hashtags. If the user insists, warn and strip them.

Defaults — do not interrogate the user

Complete a publish request in the same turn; never ask the user to supply copy or optional settings first:

  • Write title and body yourself based on the content being published — never ask the user for copy.
  • Do not ask about optional settings: omit publishAt to publish immediately, default originality/AI-label flags per the sections above (e.g. postFlag / originalStatement unchecked unless the user asks), and skip optional decorations.
  • Produce required fields yourself — when a cover is required, call extract_video_frame (optionally restyle the frame via generate_image) instead of asking the user for a URL.
  • Ask only when a decision truly blocks the call: which account to use among several usable ones (Workflow step 1), or the media to publish is missing entirely.

Validation failures and unsupported platforms

  • If the tool rejects the input, read its validation details and correct the indicated field or publish mode. If the response is ambiguous or the request times out, check publish records before submitting again.
  • For an offline account or authorization error, ask the user to reauthorize the affected account in AiToEarn 「我的频道」. A frontend guidance tool may be used if the current connector lists it.
  • If platform metadata requires a browser extension, provide the prepared content and media URLs and tell the user which extension workflow the platform specifies. Mark the status as awaiting user action. Browser automation is never a fallback for a failed server-side request.

Douyin WaitingForUserAction — two-step query and QR

Douyin uses CompletionStrategy.UserHandoff. After publish, a task may enter WaitingForUserAction. You must do a two-step query:

  1. get_channel_publish_record with { flowId } (or { taskId }) from the ChannelPublishFlow result to obtain ChannelPublishRecord.id as recordId. The publish tools return flowId + tasks[].id(taskId) only — recordId is not returned directly.
  2. get_channel_publish_user_action { recordId } to fetch schemeUrl/shortLink/expiresAt/qrImageUrl. The QR image is generated and uploaded agent-side (qrcode + AssetsService.uploadFromBuffer → qrImageUrl httpUrl) for frontend rendering. Never render raw qrText.

After step 2, echo the QR URL in the conversation as clickable shortLink + schemeUrl text plus expiresAt, and let frontend render qrImageUrl. Tell the user to scan with the Douyin App or tap the link before expiry. Continue polling get_channel_publish_record until Published / Failed.

Workflow

  1. Read get_channel_platform for the requested platform. Prepare the requested title, body, media, cover, topics and mode according to its rules.
  2. For a platform that requires a browser extension, prepare the content and any required cover, then follow the handoff above.
  3. For server-side publishing, use list_channel_accounts to find usable accounts. If none are usable, guide the user to reauthorize. If multiple are usable and the target is ambiguous, ask which to use.
  4. Find the platform's actual create flow and option tools in the current connection. Resolve required fields using the current tool schemas, then create the flow for the authorized target and mode.
  5. Use get_channel_publish_record to verify status. For Douyin WaitingForUserAction, use get_channel_publish_user_action with the resolved record ID, surface the returned QR/link and expiry, and keep the status pending until the record confirms completion.
  6. Use the relevant task tool for immediate publication, rescheduling, cancellation or supported updates.

Failed or canceled Publish Tasks are not retried. Create a new Publish Flow to publish again.