compare_documentation_versions
Compare the latest and trunk versions of JovianDSS API documentation, focusing on endpoints, changes, or a summary of differences.
Instructions
Compare latest and trunk versions of EDSS documentation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | What to focus the comparison on | summary |
Implementation Reference
- index.js:627-658 (handler)The main handler function for 'compare_documentation_versions'. Fetches both latest and trunk documentation via HTTP and delegates to compareContent().
async compareVersions(args) { const { focus = "summary" } = args; try { const [latestResponse, trunkResponse] = await Promise.all([ fetch(this.legacyDocUrls.latest), fetch(this.legacyDocUrls.trunk) ]); if (!latestResponse.ok || !trunkResponse.ok) { throw new Error("Failed to fetch both versions"); } const [latestContent, trunkContent] = await Promise.all([ latestResponse.text(), trunkResponse.text() ]); const comparison = this.compareContent(latestContent, trunkContent, focus); return { content: [ { type: "text", text: JSON.stringify(comparison, null, 2) } ] }; } catch (error) { throw new Error(`Comparison failed: ${error.message}`); } } - index.js:731-763 (helper)Helper method that performs the actual content comparison. Compares sizes and extracts endpoint differences between latest and trunk documentation.
compareContent(latest, trunk, focus) { const comparison = { timestamp: new Date().toISOString(), focus: focus }; if (focus === "summary" || focus === "all") { comparison.summary = { latest_size: latest.length, trunk_size: trunk.length, size_difference: trunk.length - latest.length, identical: latest === trunk }; } if (focus === "endpoints" || focus === "all") { const latestEndpoints = this.extractEndpoints(latest, false); const trunkEndpoints = this.extractEndpoints(trunk, false); comparison.endpoints = { latest_count: latestEndpoints.length, trunk_count: trunkEndpoints.length, latest_only: latestEndpoints.filter(le => !trunkEndpoints.some(te => te.method === le.method && te.path === le.path) ), trunk_only: trunkEndpoints.filter(te => !latestEndpoints.some(le => le.method === te.method && le.path === te.path) ) }; } return comparison; } - index.js:120-134 (schema)Input schema definition for 'compare_documentation_versions'. Defines the 'focus' parameter with enum options: endpoints, changes, summary, all.
{ name: "compare_documentation_versions", description: "Compare latest and trunk versions of EDSS documentation", inputSchema: { type: "object", properties: { focus: { type: "string", enum: ["endpoints", "changes", "summary", "all"], default: "summary", description: "What to focus the comparison on" } } } }, - index.js:195-196 (registration)Tool registration in the CallToolRequestSchema switch statement. Routes 'compare_documentation_versions' to the compareVersions() handler.
case "compare_documentation_versions": return await this.compareVersions(args); - index.js:44-175 (registration)Tool registration in the ListToolsRequestSchema handler. Lists all available tools including compare_documentation_versions with its schema.
this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "get_edss_documentation", description: "Get EDSS REST API documentation (latest or trunk version)", inputSchema: { type: "object", properties: { version: { type: "string", enum: ["latest", "trunk"], default: "latest", description: "Documentation version to retrieve" }, section: { type: "string", description: "Optional: specific section or page to retrieve (if available)" } } } }, { name: "download_edss_documentation", description: "Get download link for EDSS documentation as ZIP file", inputSchema: { type: "object", properties: { download: { type: "boolean", default: true, description: "Return download information for ZIP file" } } } }, { name: "search_edss_documentation", description: "Search for specific terms or endpoints in EDSS documentation", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search term (e.g., 'patient', 'assessment', 'POST', '/api/patients')" }, version: { type: "string", enum: ["latest", "trunk", "both"], default: "latest", description: "Which version to search" } }, required: ["query"] } }, { name: "analyze_edss_api_endpoints", description: "Extract and analyze API endpoints from EDSS documentation", inputSchema: { type: "object", properties: { version: { type: "string", enum: ["latest", "trunk"], default: "latest", description: "Documentation version to analyze" }, detailed: { type: "boolean", default: false, description: "Include detailed analysis of endpoints, parameters, and schemas" } } } }, { name: "compare_documentation_versions", description: "Compare latest and trunk versions of EDSS documentation", inputSchema: { type: "object", properties: { focus: { type: "string", enum: ["endpoints", "changes", "summary", "all"], default: "summary", description: "What to focus the comparison on" } } } }, { name: "discover_documentation_links", description: "Discover all available EDSS documentation by parsing dh.lan homepage", inputSchema: { type: "object", properties: { refresh: { type: "boolean", default: false, description: "Force refresh discovery cache" } } } }, { name: "get_edss_documentation_enhanced", description: "Get EDSS documentation with automatic version discovery and jQuery processing", inputSchema: { type: "object", properties: { version: { type: "string", default: "latest", description: "Version: 'latest', 'trunk', or specific release name" }, apiVersion: { type: "string", enum: ["v3", "v4"], default: "v4" }, useJavaScript: { type: "boolean", default: true, description: "Process with jQuery to reveal hidden content" } } } } ] }; });