Skip to main content
Glama
Cicatriiz

Consumer Rights Wiki MCP Server

get_page_sections

Extract section structure from Consumer Rights Wiki pages to navigate content on privacy violations, dark patterns, and deceptive pricing practices.

Instructions

Get the section structure of a wiki page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe title of the wiki page

Implementation Reference

  • The handler function that executes the tool logic: fetches page sections via MediaWiki API parse action, processes the sections data, and returns a structured JSON response.
    private async getPageSections(args: any) {
      const { title } = args;
    
      const data = await this.makeApiRequest({
        action: 'parse',
        page: title,
        prop: 'sections',
      });
    
      if (data.error) {
        throw new McpError(ErrorCode.InternalError, data.error.info);
      }
    
      const sections = data.parse?.sections || [];
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              title: data.parse?.title,
              sections: sections.map((section: any) => ({
                index: section.index,
                level: parseInt(section.level),
                line: section.line,
                number: section.number,
                anchor: section.anchor,
                byteoffset: section.byteoffset,
              })),
            }, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the tool, specifying the required 'title' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        title: {
          type: 'string',
          description: 'The title of the wiki page',
        },
      },
      required: ['title'],
    },
  • src/index.ts:179-180 (registration)
    Tool dispatcher in the CallToolRequestHandler switch statement, routing calls to the getPageSections method.
    case 'get_page_sections':
      return this.getPageSections(request.params.arguments);
  • src/index.ts:150-163 (registration)
    Tool metadata registration in the ListToolsRequestHandler response, including name, description, and schema.
    {
      name: 'get_page_sections',
      description: 'Get the section structure of a wiki page',
      inputSchema: {
        type: 'object',
        properties: {
          title: {
            type: 'string',
            description: 'The title of the wiki page',
          },
        },
        required: ['title'],
      },
    },

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/Cicatriiz/consumer-rights-wiki-mcp'

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