get_recent_changes
Retrieve recent edits and updates from the Consumer Rights Wiki to monitor changes in articles about privacy violations, dark patterns, and deceptive pricing practices.
Instructions
Get recent changes to the wiki
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of recent changes to return (default: 10, max: 50) | |
| namespace | No | Filter by namespace (0 = main articles) |
Implementation Reference
- src/index.ts:337-382 (handler)The main handler function for the 'get_recent_changes' tool. It extracts arguments, constructs a MediaWiki API request for recentchanges, fetches data using makeApiRequest, processes the changes into a formatted structure with details like title, timestamp, user, sizes, etc., and returns it as JSON text content.private async getRecentChanges(args: any) { const { limit = 10, namespace } = args; const params: Record<string, string> = { action: 'query', list: 'recentchanges', rcprop: 'title|timestamp|user|comment|sizes|flags', rclimit: Math.min(limit, 50).toString(), }; if (namespace !== undefined) { params.rcnamespace = namespace.toString(); } const data = await this.makeApiRequest(params); if (data.error) { throw new McpError(ErrorCode.InternalError, data.error.info); } const changes = data.query?.recentchanges || []; return { content: [ { type: 'text', text: JSON.stringify({ recentChanges: changes.map((change: any) => ({ title: change.title, timestamp: change.timestamp, user: change.user, comment: change.comment, oldSize: change.oldlen, newSize: change.newlen, sizeChange: change.newlen - change.oldlen, type: change.type, isNew: change.new === '', isMinor: change.minor === '', isBot: change.bot === '', url: `${WIKI_BASE_URL}/${change.title.replace(/ /g, '_')}`, })), }, null, 2), }, ], }; }
- src/index.ts:117-130 (schema)The input schema for the 'get_recent_changes' tool, specifying an object with optional 'limit' (number, default 10, max 50) and 'namespace' (number for filtering). No required properties.inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of recent changes to return (default: 10, max: 50)', default: 10, }, namespace: { type: 'number', description: 'Filter by namespace (0 = main articles)', }, }, },
- src/index.ts:114-131 (registration)Registration of the 'get_recent_changes' tool in the ListTools response array, providing name, description, and input schema.{ name: 'get_recent_changes', description: 'Get recent changes to the wiki', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of recent changes to return (default: 10, max: 50)', default: 10, }, namespace: { type: 'number', description: 'Filter by namespace (0 = main articles)', }, }, }, },
- src/index.ts:175-176 (registration)Dispatch case in the CallToolRequestHandler switch statement that routes calls to the getRecentChanges handler method.case 'get_recent_changes': return this.getRecentChanges(request.params.arguments);