Skip to main content
Glama

get_fixes

Provides remediation steps, polyfills, and alternatives for unsupported CSS/JS features to resolve browser compatibility issues in development projects.

Instructions

Get actionable remediation steps, polyfills, and alternatives for unsupported features

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featuresYesFeatures that need fixes (from compatibility check results)
includeCommandsNoInclude terminal commands for installation/setup
includeExamplesNoInclude code examples in the response
priorityNoFilter fixes by priority levelall

Implementation Reference

  • Handler function that processes input arguments, validates features array, calls FixGenerator.generateFixes, and formats the response with instructions.
    export function handleGetFixes(args) { const { features, priority = 'all', includeExamples = true, includeCommands = true } = args; if (!features || features.length === 0) { return { error: true, message: 'No features specified for fixes', suggestion: 'Provide an array of feature names that need fixes (from compatibility check results)' }; } const result = fixGenerator.generateFixes(features, { priority, includeExamples, includeCommands }); return { features, fixes: result.fixes, summary: result.summary, quickStart: result.quickStart, instructions: { step1: 'Review the fixes for each feature below', step2: 'Run the provided installation commands', step3: 'Follow the configuration instructions', step4: 'Use generate_configs tool for complete build setup' } }; }
  • index.js:89-125 (registration)
    Registers the get_fixes tool with the MCP server, defining its title, description, Zod input schema, and async wrapper that calls handleGetFixes and handles errors.
    // Register get_fixes tool server.registerTool( "get_fixes", { title: "Fix Generator", description: "Get actionable remediation steps, polyfills, and alternatives for unsupported features", inputSchema: { features: z.array(z.string()).describe("Features that need fixes (from compatibility check results)"), priority: z.enum(["critical", "high", "medium", "low", "all"]).optional().default("all").describe("Filter fixes by priority level"), includeExamples: z.boolean().optional().default(true).describe("Include code examples in the response"), includeCommands: z.boolean().optional().default(true).describe("Include terminal commands for installation/setup") } }, async (args) => { try { const result = handleGetFixes(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message, suggestion: "Provide an array of feature names that need fixes." }, null, 2) }], isError: true }; } } );
  • Zod input schema defining parameters: features (array of strings), priority (enum with default 'all'), includeExamples (boolean default true), includeCommands (boolean default true).
    inputSchema: { features: z.array(z.string()).describe("Features that need fixes (from compatibility check results)"), priority: z.enum(["critical", "high", "medium", "low", "all"]).optional().default("all").describe("Filter fixes by priority level"), includeExamples: z.boolean().optional().default(true).describe("Include code examples in the response"), includeCommands: z.boolean().optional().default(true).describe("Include terminal commands for installation/setup") }
  • Core helper method in FixGenerator class that generates fixes for given features by looking up a predefined fixDatabase, optionally including examples and commands, and computing summary/quickStart.
    generateFixes(features, options = {}) { const { priority = 'all', includeExamples = true, includeCommands = true } = options; const fixes = features.map(feature => { const fixInfo = this.fixDatabase[feature]; if (!fixInfo) { return { feature, status: 'unknown', message: `No fix information available for ${feature}`, suggestions: [ 'Check caniuse.com for manual compatibility info', 'Search for polyfills or alternative implementations', 'Consider progressive enhancement' ] }; } const fix = { feature, priority: fixInfo.priority, alternatives: fixInfo.alternatives, polyfills: fixInfo.polyfills || [], buildSteps: fixInfo.buildSteps || [], documentation: fixInfo.documentation }; if (includeExamples) { if (fixInfo.cssExample) fix.cssExample = fixInfo.cssExample; if (fixInfo.jsExample) fix.jsExample = fixInfo.jsExample; } if (includeCommands) { fix.commands = this._generateCommands(feature, fixInfo); } return fix; }); return { fixes, summary: this._generateFixSummary(fixes), quickStart: this._generateQuickStart(fixes) }; }

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/Amirmahdi-Kaheh/caniuse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server