Skip to main content
Glama
Nettention

ProudNet Document MCP

Official
by Nettention

get_proudnet_page

Retrieve content from ProudNet documentation pages to access specific guides, API references, and technical information for the networking library.

Instructions

Get content from a specific ProudNet documentation page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the documentation page (e.g., /guides/getting-started)

Implementation Reference

  • The main handler function that fetches the ProudNet documentation page using axios and cheerio, extracts main content and code blocks, and returns formatted text content.
    async getPage(path) {
      try {
        let url;
        
        if (path.startsWith('http')) {
          url = path;
        } else {
          // Default to docs.proudnet.com if no domain is specified
          if (path.includes('guide.nettention.com') || path.includes('help.nettention.com')) {
            url = path.startsWith('/') ? `https:/${path}` : `https://${path}`;
          } else {
            url = `https://docs.proudnet.com${path.startsWith('/') ? path : '/' + path}`;
          }
        }
        
        const response = await axios.get(url);
        const $ = cheerio.load(response.data);
        
        // Remove script and style elements
        $('script, style').remove();
        
        // Extract main content
        const content = $('.content, main, article, [role="main"]').first();
        const text = content.length > 0 
          ? content.text().trim() 
          : $('body').text().trim();
        
        // Extract code examples
        const codeBlocks = [];
        $('pre code, .highlight').each((_, elem) => {
          codeBlocks.push($(elem).text().trim());
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Content from ${url}:\n\n${text.substring(0, 3000)}${text.length > 3000 ? '...' : ''}${
                codeBlocks.length > 0 
                  ? '\n\nCode Examples:\n' + codeBlocks.slice(0, 3).join('\n---\n')
                  : ''
              }`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to get page: ${error.message}`);
      }
    }
  • Input schema definition for the get_proudnet_page tool, specifying the 'path' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'Path to the documentation page (e.g., /guides/getting-started)',
        },
      },
      required: ['path'],
    },
  • server.js:44-57 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'get_proudnet_page',
      description: 'Get content from a specific ProudNet documentation page',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Path to the documentation page (e.g., /guides/getting-started)',
          },
        },
        required: ['path'],
      },
    },
  • server.js:78-79 (registration)
    Switch case in CallToolRequestHandler that dispatches to the getPage handler method.
    case 'get_proudnet_page':
      return await this.getPage(args.path);

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/Nettention/proudnet-document-mcp'

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