{"url_pattern":"^https?://mp\\.weixin\\.qq\\.com/.*$","site_name":"wechat","allowed_domains":null,"tools":[{"name":"insert_article","description":"Insert content into WeChat Official Account article editor (must be on editor page with action=edit)","inputSchema":{"type":"object","properties":{"title":{"type":"string","description":"Article title"},"content":{"type":"string","description":"Article content (HTML or plain text)"}},"required":["content"]},"handler":"(params) => {\n  // New WeChat editor uses multiple ProseMirror instances\n  const allEditors = document.querySelectorAll('.ProseMirror');\n  let titleEditor = null;\n  let contentEditor = null;\n  \n  // Find title and content editors\n  allEditors.forEach(editor => {\n    const placeholder = editor.getAttribute('data-placeholder') || '';\n    const parentClass = editor.parentElement?.className || '';\n    \n    if (placeholder.includes('标题')) {\n      titleEditor = editor;\n    } else if (parentClass.includes('rich_media_content')) {\n      // Content editor has parent with rich_media_content class\n      contentEditor = editor;\n    }\n  });\n  \n  // Fallback: if only 2 ProseMirror editors, use the non-title one as content\n  if (!contentEditor && allEditors.length === 2 && titleEditor) {\n    allEditors.forEach(editor => {\n      if (editor !== titleEditor) contentEditor = editor;\n    });\n  }\n  \n  // Fallback to old selectors\n  if (!titleEditor) {\n    titleEditor = document.querySelector('#title') || document.querySelector('[placeholder*=\"标题\"]');\n  }\n  if (!contentEditor) {\n    contentEditor = document.querySelector('.edui-body-container');\n  }\n  \n  // Set title if provided\n  if (params.title && titleEditor) {\n    if (titleEditor.tagName === 'TEXTAREA' || titleEditor.tagName === 'INPUT') {\n      titleEditor.value = params.title;\n    } else {\n      titleEditor.innerHTML = `<p>${params.title}</p>`;\n    }\n    titleEditor.dispatchEvent(new Event('input', { bubbles: true }));\n  }\n  \n  // Insert content\n  if (!contentEditor) {\n    return { success: false, message: 'Content editor not found. Make sure you are on the article edit page' };\n  }\n  contentEditor.focus();\n  contentEditor.innerHTML = params.content;\n  contentEditor.dispatchEvent(new Event('input', { bubbles: true }));\n  \n  return { success: true, message: 'Content inserted into WeChat editor' };\n}"},{"name":"navigate_to_draft","description":"Navigate from WeChat home to draft page","inputSchema":{"type":"object","properties":{},"required":null},"handler":"() => {\n  // Click 内容管理 menu\n  const contentMgmt = document.querySelector('[title=\"内容管理\"]');\n  if (contentMgmt) {\n    contentMgmt.click();\n    setTimeout(() => {\n      const draftLink = Array.from(document.querySelectorAll('a')).find(a => a.textContent.includes('草稿箱'));\n      if (draftLink) draftLink.click();\n    }, 800);\n    return { success: true, message: 'Navigating to draft page...' };\n  }\n  return { success: false, message: 'Content management menu not found' };\n}"},{"name":"create_new_article","description":"Click to create new article from draft page","inputSchema":{"type":"object","properties":{},"required":null},"handler":"() => {\n  const newCreateCard = document.querySelector('.weui-desktop-card_new');\n  if (newCreateCard) {\n    newCreateCard.click();\n    setTimeout(() => {\n      const writeLink = document.querySelector('li[data-type=\"0\"] a');\n      if (writeLink) {\n        writeLink.click();\n      }\n    }, 500);\n    return { success: true, message: 'Opening new article editor...' };\n  }\n  return { success: false, message: 'New creation card not found' };\n}"}]}