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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on how it behaves: it doesn't specify if this is a read-only operation, what the output format is (e.g., text, structured data), whether it requires authentication, or any rate limits. The description is minimal and doesn't compensate for the absence of annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently conveys the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of providing remediation guidance and the absence of both annotations and an output schema, the description is incomplete. It doesn't explain what the output will look like (e.g., step-by-step instructions, code snippets), any dependencies on other tools, or error handling. For a tool that likely returns detailed guidance, more context is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'category' well-documented in the schema as 'Pattern category (e.g., "Session State", "Static Mutable Field")'. The description adds no additional meaning beyond this, such as explaining what constitutes a valid category or providing more examples. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'detailed remediation guidance for a specific stateful pattern', making the purpose understandable. It doesn't explicitly distinguish from sibling tools like 'analyze_git_repository' or 'get_project_findings', which appear to be analysis tools rather than remediation guidance tools, but the distinction is somewhat implied by the different focus areas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing prior analysis results, or specify scenarios where this tool is appropriate compared to siblings like 'generate_analysis_script' or 'get_project_findings'. Usage is implied only by the tool's name and purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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