Skip to main content
Glama
Cicatriiz

Consumer Rights Wiki MCP Server

get_page_sections

Extract the section structure of a Consumer Rights Wiki page by providing its title, helping users navigate and analyze content on consumer exploitation topics like privacy violations and deceptive pricing.

Instructions

Get the section structure of a wiki page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe title of the wiki page

Implementation Reference

  • The main handler function for the 'get_page_sections' tool. It takes a page title, queries the MediaWiki API for parse sections, processes the sections data, and returns a structured JSON response with section details including index, level, line, number, anchor, and byteoffset.
    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), }, ], }; }
  • src/index.ts:150-163 (registration)
    Tool registration in the ListTools handler, defining the tool name, description, and input schema requiring a 'title' string.
    { 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'], }, },
  • src/index.ts:179-180 (registration)
    Dispatch registration in the CallToolRequest handler switch statement, routing calls to the getPageSections method.
    case 'get_page_sections': return this.getPageSections(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