Skip to main content
Glama

explain_remediation

Get detailed remediation guidance for stateful code patterns in .NET and Java projects to help migrate applications to stateless architectures.

Instructions

Get detailed remediation guidance for a specific stateful pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesPattern category (e.g., "Session State", "Static Mutable Field")

Implementation Reference

  • The main handler function that executes the tool: loads remediation-actions.json, finds the category match, formats and returns markdown guidance, or lists available categories if not found.
    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,
        };
      }
    },
  • Tool definition including name, description, and input schema requiring a 'category' string.
    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'],
      },
    },
  • Registers the tool definition in the ListToolsRequestHandler response.
      analyzeGitTool.definition,
      analyzeLocalTool.definition,
      generateScriptTool.definition,
      getFindingsTool.definition,
      explainRemediationTool.definition,
    ],
  • Registers the tool execution handler in the CallToolRequestHandler switch statement.
    case 'explain_remediation':
      return await explainRemediationTool.execute(args);

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

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