Skip to main content
Glama
explain-remediation.js2.03 kB
const path = require('path'); const fs = require('fs').promises; module.exports = { definition: { name: 'explain_remediation', description: 'Get detailed remediation guidance for a specific stateful pattern', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Pattern category (e.g., "Session State", "Static Mutable Field")', }, }, required: ['category'], }, }, async execute(args) { try { const { category } = args; // Load remediation actions from JSON file const remediationPath = path.join(__dirname, '../data/remediation-actions.json'); const remediationData = JSON.parse(await fs.readFile(remediationPath, 'utf-8')); // Find matching category const remediation = remediationData.actions.find( (action) => action.category.toLowerCase() === category.toLowerCase() ); if (!remediation) { return { content: [ { type: 'text', text: `No remediation guidance found for category: ${category}\n\nAvailable categories:\n${remediationData.actions.map(a => `- ${a.category}`).join('\n')}`, }, ], }; } // Format remediation guidance const guidance = `# Remediation: ${remediation.category}\n\n` + `**Effort**: ${remediation.effortWeight} points\n\n` + `## Actions Required:\n\n` + remediation.subActions.map((action, idx) => `${idx + 1}. **${action.action}** (${action.effort} points)\n ${action.description || ''}` ).join('\n\n'); return { content: [ { type: 'text', text: guidance, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error explaining remediation: ${error.message}`, }, ], isError: true, }; } }, };

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/aloksinghGIT/statelessor-mcp'

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