search_proudnet_docs
Search ProudNet networking library documentation using natural language queries to find specific topics and information.
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 handler function that implements the 'search_proudnet_docs' tool. It scrapes specified ProudNet documentation URLs using axios and cheerio, searches for the query in text of links and headings, collects matching results, and returns formatted text output.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)The input schema defining the expected input for the 'search_proudnet_docs' tool: 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 list of available tools returned by ListToolsRequestHandler.{ 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:75-76 (registration)Dispatch case in the CallToolRequestHandler switch statement that routes calls to the searchDocs handler.case 'search_proudnet_docs': return await this.searchDocs(args.query);