Skip to main content
Glama
Cicatriiz

Consumer Rights Wiki MCP Server

get_page_content

Retrieve the full content or specific sections of a wiki page from the Consumer Rights Wiki to access detailed information on consumer exploitation issues like privacy violations and deceptive practices.

Instructions

Get the full content of a specific wiki page

Input Schema

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

Implementation Reference

  • The core implementation of the get_page_content tool handler. It fetches the wiki page content via the MediaWiki parse API, cleans the HTML to plain text, and returns a structured JSON with title, content, categories, sections, links, and URL.
    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), }, ], }; }
  • The input schema definition for the get_page_content tool, specifying required 'title' parameter and optional 'section'.
    { 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'], }, },
  • src/index.ts:171-172 (registration)
    The registration of the get_page_content tool in the CallToolRequest handler switch statement, dispatching to the getPageContent method.
    case 'get_page_content': return this.getPageContent(request.params.arguments);

Other Tools

Related Tools

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