search_proudnet_docs
Search ProudNet networking library documentation to find specific topics and technical information for development needs.
Instructions
Search ProudNet documentation for specific topics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query for ProudNet documentation |
Implementation Reference
- server.js:100-161 (handler)The function that executes the tool logic for 'search_proudnet_docs'. It scrapes three ProudNet documentation websites using axios and cheerio, searches for the query in link and heading texts, constructs full URLs, collects matching results, and returns a formatted text response with the findings.async searchDocs(query) { try { const urls = [ 'https://docs.proudnet.com/proudnet', 'https://guide.nettention.com', 'https://help.nettention.com' ]; const results = []; for (const url of urls) { try { const response = await axios.get(url); const $ = cheerio.load(response.data); // Search through all links and headings $('a, h1, h2, h3, h4').each((_, elem) => { const text = $(elem).text().toLowerCase(); const href = $(elem).attr('href') || $(elem).find('a').attr('href'); if (text.includes(query.toLowerCase())) { let fullUrl = null; if (href) { if (href.startsWith('http')) { fullUrl = href; } else if (href.startsWith('/')) { const baseUrl = new URL(url); fullUrl = `${baseUrl.origin}${href}`; } else { fullUrl = `${url}/${href}`; } } results.push({ title: $(elem).text().trim(), url: fullUrl, source: url, type: elem.name, }); } }); } catch (siteError) { console.error(`Failed to search ${url}: ${siteError.message}`); } } return { content: [ { type: 'text', text: results.length > 0 ? `Found ${results.length} results for "${query}":\n\n${results.map(r => `- ${r.title}${r.url ? ` (${r.url})` : ''} [from ${r.source}]` ).join('\n')}` : `No results found for "${query}"`, }, ], }; } catch (error) { throw new Error(`Failed to search docs: ${error.message}`); } }
- server.js:33-42 (schema)Input schema definition for the 'search_proudnet_docs' tool, specifying an object with a required 'query' string property.inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query for ProudNet documentation', }, }, required: ['query'], },
- server.js:30-43 (registration)Registration of the 'search_proudnet_docs' tool in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'search_proudnet_docs', description: 'Search ProudNet documentation for specific topics', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query for ProudNet documentation', }, }, required: ['query'], }, },
- server.js:74-86 (registration)Handler dispatch switch statement in CallToolRequestSchema that routes 'search_proudnet_docs' calls to the searchDocs method.switch (name) { case 'search_proudnet_docs': return await this.searchDocs(args.query); case 'get_proudnet_page': return await this.getPage(args.path); case 'list_proudnet_sections': return await this.listSections(); default: throw new Error(`Unknown tool: ${name}`); }