Skip to main content
Glama

ai_search_oschina

Search Open Source China for technical news, blogs, questions, and projects. Returns search URLs for accessing results through WebFetch.

Instructions

🌐 开源中国搜索 - 搜索开源中国技术资讯和项目

【重要】此工具会返回开源中国搜索URL,Claude Code应该使用WebFetch工具访问该URL以获取真实搜索结果。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes搜索关键词
typeNo搜索类型all

Implementation Reference

  • Handler for ai_search_oschina and similar domestic search tools: validates input, constructs OSChina search URL, generates formatted response with WebFetch instructions, saves detailed results to file.
    case 'ai_search_csdn':
    case 'ai_search_juejin':
    case 'ai_search_segmentfault':
    case 'ai_search_cnblogs':
    case 'ai_search_oschina':
    case 'ai_search_aliyun_docs':
    case 'ai_search_tencent_docs': {
      const rawQuery = normalizeString(args.query);
    
      if (!rawQuery) {
        throw new Error('搜索关键词不能为空');
      }
    
      const searchUrls = {
        ai_search_csdn: `https://so.csdn.net/so/search?q=${encodeURIComponent(rawQuery)}`,
        ai_search_juejin: `https://juejin.cn/search?query=${encodeURIComponent(rawQuery)}`,
        ai_search_segmentfault: `https://segmentfault.com/search?q=${encodeURIComponent(rawQuery)}`,
        ai_search_cnblogs: `https://zzk.cnblogs.com/s?w=${encodeURIComponent(rawQuery)}`,
        ai_search_oschina: `https://www.oschina.net/search?scope=all&q=${encodeURIComponent(rawQuery)}`,
        ai_search_aliyun_docs: `https://help.aliyun.com/search?spm=a2c4g.11186623.0.0&k=${encodeURIComponent(rawQuery)}`,
        ai_search_tencent_docs: `https://cloud.tencent.com/search?s=doc&keyword=${encodeURIComponent(rawQuery)}`
      };
    
      const platformInfo = {
        ai_search_csdn: {
          name: 'CSDN',
          icon: '📝',
          description: '中国最大的IT社区和服务平台',
          tips: ['博客文章', '技术问答', '代码片段', '下载资源'],
          homepage: 'https://www.csdn.net/',
          toolKey: 'csdn-search'
        },
        ai_search_juejin: {
          name: '掘金',
          icon: '💎',
          description: '面向开发者的技术内容分享平台',
          tips: ['前端开发', '后端开发', 'Android', 'iOS', '人工智能'],
          homepage: 'https://juejin.cn/',
          toolKey: 'juejin-search'
        },
        ai_search_segmentfault: {
          name: 'SegmentFault',
          icon: '🔧',
          description: '中文技术问答社区',
          tips: ['技术问答', '技术文章', '活动沙龙', '编程挑战'],
          homepage: 'https://segmentfault.com/',
          toolKey: 'sf-search'
        },
        ai_search_cnblogs: {
          name: '博客园',
          icon: '📚',
          description: '开发者的网上家园',
          tips: ['.NET', 'C#', 'Java', 'Python', '数据库'],
          homepage: 'https://www.cnblogs.com/',
          toolKey: 'cnblogs-search'
        },
        ai_search_oschina: {
          name: '开源中国',
          icon: '🌐',
          description: '中国最大的开源技术社区',
          tips: ['开源项目', '技术资讯', '代码托管', '协作翻译'],
          homepage: 'https://www.oschina.net/',
          toolKey: 'oschina-search'
        },
        ai_search_aliyun_docs: {
          name: '阿里云文档',
          icon: '☁️',
          description: '阿里云产品文档中心',
          tips: ['ECS', 'OSS', 'RDS', 'SLB', '容器服务'],
          homepage: 'https://help.aliyun.com/',
          toolKey: 'aliyun-docs'
        },
        ai_search_tencent_docs: {
          name: '腾讯云文档',
          icon: '☁️',
          description: '腾讯云产品文档中心',
          tips: ['CVM', 'COS', 'CDN', 'SCF', '数据库'],
          homepage: 'https://cloud.tencent.com/document/product',
          toolKey: 'tencent-docs'
        }
      };
    
      const info = platformInfo[name];
      const searchUrl = searchUrls[name];
    
      const detailsContent = `${info.icon} ${info.name} 搜索\n\n` +
        `**搜索关键词**: ${rawQuery}\n` +
        `**平台介绍**: ${info.description}\n\n` +
        `---\n\n` +
        `🔗 **搜索链接**: ${searchUrl}\n\n` +
        `⚠️ **请使用 WebFetch 工具获取搜索结果**:\n` +
        `\`\`\`javascript\n` +
        `WebFetch({\n` +
        `  url: "${searchUrl}",\n` +
        `  prompt: "提取前10条搜索结果(标题、作者、发布时间、摘要、链接)"\n` +
        `})\n` +
        `\`\`\`\n\n` +
        `---\n\n` +
        `💡 **${info.name} 热门主题**:\n` +
        info.tips.map(tip => `• ${tip}`).join(' | ') +
        `\n\n🏠 **平台首页**: ${info.homepage}\n\n` +
        `📌 **搜索建议**:\n` +
        `• 使用精确关键词获得更好的结果\n` +
        `• 结合多个平台搜索可获得更全面的信息\n` +
        `• 关注文章的发布时间,优先查看最新内容`;
    
      const filepath = await saveSearchResult(info.toolKey, rawQuery, detailsContent);
    
      return makeTextResponse(
        `${info.icon} **${info.name}搜索**\n\n` +
        `**关键词**: ${rawQuery}\n` +
        `**搜索链接**: ${searchUrl}\n\n` +
        `✅ 详细信息已保存至: ${filepath || '保存失败'}\n` +
        `💡 使用 WebFetch 工具访问搜索链接获取结果`
      );
    }
  • Input schema and description for the ai_search_oschina tool, defining query parameter as required and optional type parameter.
    {
      name: 'ai_search_oschina',
      description: '🌐 开源中国搜索 - 搜索开源中国技术资讯和项目\n\n【重要】此工具会返回开源中国搜索URL,Claude Code应该使用WebFetch工具访问该URL以获取真实搜索结果。',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: '搜索关键词' },
          type: { type: 'string', enum: ['news', 'blog', 'ask', 'project', 'all'], description: '搜索类型', default: 'all' }
        },
        required: ['query']
      }
    },
  • Registration of all tools including ai_search_oschina via the ListToolsRequestSchema handler, returning the AI_TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: AI_TOOLS,
    }));
  • Platform configuration helper for ai_search_oschina, providing name, icon, description, tips, homepage, and toolKey used in handler.
    ai_search_oschina: {
      name: '开源中国',
      icon: '🌐',
      description: '中国最大的开源技术社区',
      tips: ['开源项目', '技术资讯', '代码托管', '协作翻译'],
      homepage: 'https://www.oschina.net/',
      toolKey: 'oschina-search'
    },
  • Search URL construction for ai_search_oschina within the handler's searchUrls object.
    const searchUrls = {
      ai_search_csdn: `https://so.csdn.net/so/search?q=${encodeURIComponent(rawQuery)}`,
      ai_search_juejin: `https://juejin.cn/search?query=${encodeURIComponent(rawQuery)}`,
      ai_search_segmentfault: `https://segmentfault.com/search?q=${encodeURIComponent(rawQuery)}`,
      ai_search_cnblogs: `https://zzk.cnblogs.com/s?w=${encodeURIComponent(rawQuery)}`,
      ai_search_oschina: `https://www.oschina.net/search?scope=all&q=${encodeURIComponent(rawQuery)}`,
      ai_search_aliyun_docs: `https://help.aliyun.com/search?spm=a2c4g.11186623.0.0&k=${encodeURIComponent(rawQuery)}`,
      ai_search_tencent_docs: `https://cloud.tencent.com/search?s=doc&keyword=${encodeURIComponent(rawQuery)}`
    };
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It helpfully reveals that the tool returns URLs rather than actual content and requires WebFetch for real results, which is valuable behavioral context. However, it doesn't mention rate limits, authentication needs, or what happens with invalid queries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that each serve distinct purposes: the first states the core function, the second provides critical implementation guidance. The emoji adds visual distinction but doesn't detract from clarity. The information is front-loaded with the most important details first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no annotations and no output schema, the description provides adequate but incomplete context. It explains what the tool does and the critical implementation detail about URL returns, but doesn't describe the format of returned URLs, error conditions, or result limitations. Given the complexity of search tools and lack of structured metadata, more behavioral detail would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage with clear parameter documentation, so the baseline is 3. The tool description doesn't add any parameter-specific information beyond what's already in the schema - it doesn't explain search syntax, result limitations, or provide examples of effective queries.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for '开源中国技术资讯和项目' (Open Source China technical information and projects), providing a specific verb (search) and resource (Open Source China content). It distinguishes itself from siblings by specifying the target platform, though it doesn't explicitly contrast with other search tools like ai_search_github or ai_search_csdn.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (searching Open Source China content) and includes an important usage note about requiring WebFetch to access actual results. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the many sibling search tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adminhuan/smart-search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server