Skip to main content
Glama

generate_analysis_script

Create bash or PowerShell scripts to analyze .NET and Java projects for stateful code patterns, providing remediation guidance for stateless architecture migration.

Instructions

Generate a bash or PowerShell script for offline analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptTypeYesType of script to generate

Implementation Reference

  • The handler function that implements the core logic of the 'generate_analysis_script' tool. It extracts the scriptType from input arguments, fetches the script content via apiClient, formats user instructions, and returns a formatted markdown response with the script.
      async execute(args) {
        try {
          const { scriptType } = args;
    
          // Call Statelessor API
          const scriptContent = await apiClient.generateScript(scriptType);
    
          // Format instructions
          const instructions = scriptType === 'bash'
            ? `To use this script:
    1. Save as analyze.sh
    2. Make executable: chmod +x analyze.sh
    3. Run: ./analyze.sh /path/to/project
    4. Results will be saved as findings.json`
            : `To use this script:
    1. Save as analyze.ps1
    2. Run: .\\analyze.ps1 -ProjectPath "C:\\path\\to\\project"
    3. Results will be saved as findings.json`;
    
          return {
            content: [
              {
                type: 'text',
                text: `# ${scriptType.toUpperCase()} Analysis Script\n\n${instructions}\n\n\`\`\`${scriptType}\n${scriptContent}\n\`\`\``,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error generating script: ${error.message}`,
              },
            ],
            isError: true,
          };
        }
      },
  • The tool definition including name, description, and inputSchema for validation (scriptType: 'bash' or 'powershell').
    definition: {
      name: 'generate_analysis_script',
      description: 'Generate a bash or PowerShell script for offline analysis',
      inputSchema: {
        type: 'object',
        properties: {
          scriptType: {
            type: 'string',
            enum: ['bash', 'powershell'],
            description: 'Type of script to generate',
          },
        },
        required: ['scriptType'],
      },
    },
  • mcp-server.js:59-60 (registration)
    Registration in the MCP server switch statement: dispatches tool calls named 'generate_analysis_script' to the generateScriptTool.execute handler.
    case 'generate_analysis_script':
      return await generateScriptTool.execute(args);
  • Helper function in API client that makes HTTP GET request to Statelessor API to retrieve the raw script content for the specified scriptType.
    async generateScript(scriptType) {
      const requestId = this.generateRequestId();
      
      try {
        const endpoint = scriptType === 'bash' ? '/api/script/bash' : '/api/script/powershell';
        const response = await this.client.get(endpoint, {
          headers: {
            'X-Request-ID': requestId,
          },
        });
    
        return response.data;
      } catch (error) {
        throw this.handleError(error, 'generateScript');
      }
    }
  • mcp-server.js:43-43 (registration)
    Tool definition registration in the ListToolsRequestSchema handler, exposing the schema to MCP clients.
    generateScriptTool.definition,
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 the tool generates a script but doesn't explain what the script does, how it's used for 'offline analysis,' whether it requires specific inputs or permissions, or what the output format is. This leaves critical behavioral traits unspecified, making it inadequate for a tool with no annotation support.

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, efficient sentence: 'Generate a bash or PowerShell script for offline analysis.' It's front-loaded with the core action and resource, with no wasted words or redundant information. This makes it highly concise and well-structured for quick understanding.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'offline analysis' entails, what the generated script does, or how to use the output. For a tool that generates scripts, more context is needed to understand its behavior and application, making it insufficient for effective agent use.

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 input schema has 100% description coverage, with the parameter 'scriptType' fully documented in the schema. The description mentions 'bash or PowerShell script,' which aligns with the enum values but doesn't add any semantic details beyond what the schema provides. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description adds minimal extra value.

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 tool's purpose: 'Generate a bash or PowerShell script for offline analysis.' It specifies the verb ('generate'), resource ('script'), and context ('for offline analysis'), which is clear and specific. However, it doesn't explicitly differentiate from sibling tools like 'analyze_git_repository' or 'explain_remediation,' which might also involve analysis-related tasks, so it doesn't reach the highest score.

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 any prerequisites, contexts, or exclusions, and it doesn't reference sibling tools like 'analyze_git_repository' or 'explain_remediation' to help the agent choose appropriately. This lack of usage context leaves the agent without clear direction.

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