list_proudnet_sections
Retrieve the main documentation sections for the ProudNet networking library to quickly navigate and access specific technical information.
Instructions
List main sections of ProudNet documentation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:213-280 (handler)The handler function for the 'list_proudnet_sections' tool. It scrapes navigation links from multiple ProudNet documentation websites using Cheerio and Axios, collects unique section titles and paths (up to 10 per site), formats them, and returns as a text response.async listSections() { try { const urls = [ 'https://docs.proudnet.com/proudnet', 'https://guide.nettention.com', 'https://help.nettention.com' ]; const allSections = []; for (const url of urls) { try { const response = await axios.get(url); const $ = cheerio.load(response.data); const sections = []; // Find navigation or main sections $('.nav-link, .sidebar a, nav a, [class*="menu"] a').each((_, elem) => { const text = $(elem).text().trim(); const href = $(elem).attr('href'); if (text && href && !sections.find(s => s.title === text)) { let fullPath = href; if (!href.startsWith('http')) { if (href.startsWith('/')) { const baseUrl = new URL(url); fullPath = `${baseUrl.origin}${href}`; } else { fullPath = `${url}/${href}`; } } sections.push({ title: text, path: fullPath, source: url, }); } }); allSections.push({ site: url, sections: sections.slice(0, 10) }); } catch (siteError) { console.error(`Failed to get sections from ${url}: ${siteError.message}`); } } const formattedSections = allSections.map(site => `From ${site.site}:\n${site.sections.map(s => `- ${s.title}: ${s.path}` ).join('\n')}` ).join('\n\n'); return { content: [ { type: 'text', text: `Documentation Sections:\n\n${formattedSections}`, }, ], }; } catch (error) { throw new Error(`Failed to list sections: ${error.message}`); } }
- server.js:61-64 (schema)The input schema definition for the 'list_proudnet_sections' tool, specifying an empty object (no required parameters).inputSchema: { type: 'object', properties: {}, },
- server.js:58-65 (registration)Registration of the 'list_proudnet_sections' tool in the ListToolsRequestSchema response, including name, description, and schema.{ name: 'list_proudnet_sections', description: 'List main sections of ProudNet documentation', inputSchema: { type: 'object', properties: {}, }, },
- server.js:81-83 (registration)Registration and dispatch of the 'list_proudnet_sections' tool in the CallToolRequestSchema switch statement, calling the listSections handler.case 'list_proudnet_sections': return await this.listSections();