{"url_pattern":"^https?://editor\\.csdn\\.net/.*$","site_name":"csdn","allowed_domains":["editor.csdn.net","so.csdn.net"],"tools":[{"name":"csdn_search","description":"CSDN 技术文章搜索","inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Search query"},"page":{"type":"string","description":"Page number (default 1)"}},"required":["query"]},"handler":"(params) => {\n  const run = async function(args) {\n\n      if (!args.query) return {error: 'Missing argument: query'};\n      const page = parseInt(args.page) || 1;\n\n      const url = 'https://so.csdn.net/api/v3/search?q=' + encodeURIComponent(args.query)\n        + '&t=all&p=' + page\n        + '&s=0&tm=0&lv=-1&ft=0&l=&u=&ct=-1&pnt=-1&ry=-1&ss=-1&dct=-1&vco=-1&cc=-1&sc=-1&ald=-1&ep=&wp=0';\n\n      const resp = await fetch(url, {credentials: 'include'});\n      if (!resp.ok) return {error: 'HTTP ' + resp.status, hint: 'Make sure so.csdn.net is accessible'};\n\n      const d = await resp.json();\n\n      const strip = (html) => (html || '').replace(/<[^>]+>/g, '').replace(/&nbsp;/g, ' ')\n        .replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&').trim();\n\n      const results = (d.result_vos || []).map((item, i) => ({\n        rank: (page - 1) * 20 + i + 1,\n        type: item.type,\n        title: strip(item.title || ''),\n        url: item.url || '',\n        description: strip(item.description || item.body || '').substring(0, 300),\n        author: item.nickname || item.author || '',\n        views: parseInt(item.view) || 0,\n        likes: parseInt(item.digg) || 0,\n        collections: parseInt(item.collections) || 0,\n        created: item.create_time ? new Date(parseInt(item.create_time)).toISOString() : null\n      }));\n\n      return {\n        query: args.query,\n        page: page,\n        total: d.total || 0,\n        count: results.length,\n        results: results\n      };\n  };\n  return run(params || {});\n}"},{"name":"insert_article","description":"Insert content into CSDN article editor (Markdown)","inputSchema":{"type":"object","properties":{"title":{"type":"string","description":"Article title"},"content":{"type":"string","description":"Article content (Markdown)"}},"required":["content"]},"handler":"(params) => {\n  // Set title\n  if (params.title) {\n    const titleInput = document.querySelector('.article-bar__title input') || document.querySelector('input[placeholder*=\"标题\"]');\n    if (titleInput) {\n      titleInput.value = params.title;\n      titleInput.dispatchEvent(new Event('input', { bubbles: true }));\n    }\n  }\n  // Find editor (CSDN uses CodeMirror)\n  const cmElement = document.querySelector('.CodeMirror');\n  if (cmElement && cmElement.CodeMirror) {\n    cmElement.CodeMirror.setValue(params.content);\n    return { success: true, message: 'Content inserted into CSDN editor' };\n  }\n  // Fallback to textarea\n  const textarea = document.querySelector('.editor__inner textarea');\n  if (textarea) {\n    textarea.value = params.content;\n    textarea.dispatchEvent(new Event('input', { bubbles: true }));\n    return { success: true, message: 'Content inserted into CSDN editor' };\n  }\n  return { success: false, message: 'Editor not found. Open editor.csdn.net first' };\n}"},{"name":"open_editor","description":"Navigate to CSDN Markdown editor","inputSchema":{"type":"object","properties":{},"required":null},"handler":"() => {\n  window.location.href = 'https://editor.csdn.net/md/';\n  return { success: true, message: 'Opening CSDN editor...' };\n}"}]}