Skip to main content
Glama
Cicatriiz

Consumer Rights Wiki MCP Server

get_page_content

Retrieve complete content from Consumer Rights Wiki pages to access detailed information about privacy violations, dark patterns, and deceptive pricing practices.

Instructions

Get the full content of a specific wiki page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe title of the wiki page
sectionNoOptional section number to retrieve

Implementation Reference

  • The core handler function that executes the get_page_content tool logic: fetches wiki page content via API, strips HTML, processes entities, and returns structured JSON response.
    private async getPageContent(args: any) { const { title, section } = args; const params: Record<string, string> = { action: 'parse', page: title, prop: 'text|sections|categories|links|externallinks', disablelimitreport: '1', disableeditsection: '1', }; if (section !== undefined) { params.section = section.toString(); } const data = await this.makeApiRequest(params); if (data.error) { throw new McpError(ErrorCode.InternalError, data.error.info); } const parse = data.parse; if (!parse) { throw new McpError(ErrorCode.InvalidRequest, `Page '${title}' not found`); } // Extract text content and remove HTML const htmlContent = parse.text['*']; const textContent = htmlContent .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '') .replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, '') .replace(/<[^>]*>/g, '') .replace(/&nbsp;/g, ' ') .replace(/&amp;/g, '&') .replace(/&lt;/g, '<') .replace(/&gt;/g, '>') .replace(/&quot;/g, '"') .replace(/&#039;/g, "'") .replace(/\n\s*\n/g, '\n\n') .trim(); return { content: [ { type: 'text', text: JSON.stringify({ title: parse.title, pageid: parse.pageid, content: textContent, categories: parse.categories?.map((cat: any) => cat['*']) || [], sections: parse.sections || [], internalLinks: parse.links?.map((link: any) => link['*']) || [], externalLinks: parse.externallinks || [], url: `${WIKI_BASE_URL}/${title.replace(/ /g, '_')}`, }, null, 2), }, ], }; }
  • src/index.ts:82-99 (registration)
    Tool registration in the listTools handler, including name, description, and input schema definition.
    { name: 'get_page_content', description: 'Get the full content of a specific wiki page', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'The title of the wiki page', }, section: { type: 'number', description: 'Optional section number to retrieve', }, }, required: ['title'], }, },
  • Dispatch case in the central CallToolRequestSchema handler that routes calls to the getPageContent method.
    case 'get_page_content': return this.getPageContent(request.params.arguments);
  • Utility helper function used by getPageContent to perform API requests to the wiki endpoint.
    private async makeApiRequest(params: Record<string, string>): Promise<WikiResponse> { try { const response = await axios.get(API_ENDPOINT, { params: { format: 'json', ...params, }, }); return response.data; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to make API request: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }

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