Skip to main content
Glama
abdessamad-elamrani

MalwareAnalyzerMCP

strings

Extract printable strings from files to analyze malware by revealing embedded text, URLs, and configuration data for security investigation.

Instructions

Extract printable strings from a file

Example usage:

  • Basic strings extraction: { "target": "suspicious.exe" }

  • With minimum length: { "target": "suspicious.exe", "minLength": 10 }

  • With encoding: { "target": "suspicious.exe", "encoding": "l" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget file or data to analyze
optionsNoAdditional command-line options
minLengthNoMinimum string length to display
encodingNoString encoding (s=7-bit, S=8-bit, b=16-bit big-endian, l=16-bit little-endian, etc.)

Implementation Reference

  • The buildCommand function constructs the shell command string for the 'strings' tool by incorporating optional parameters like minLength and encoding.
    buildCommand: (args) => {
      let options = args.options ? args.options : '';
      
      if (args.minLength) {
        options += ` -n ${args.minLength}`;
      }
      
      if (args.encoding) {
        options += ` -e ${args.encoding}`;
      }
      
      return `strings ${options} ${args.target}`;
    },
  • Zod schema definition for the 'strings' tool inputs, extending base schema with minLength and encoding parameters.
    strings: {
      name: 'strings',
      description: 'Extract printable strings from a file',
      schema: baseCommandSchema.extend({
        minLength: z.number().optional().describe("Minimum string length to display"),
        encoding: z.enum(['s', 'S', 'b', 'l', 'B', 'L']).optional().describe("String encoding (s=7-bit, S=8-bit, b=16-bit big-endian, l=16-bit little-endian, etc.)")
      }),
  • serverMCP.js:112-121 (registration)
    Dynamically registers all specialized tools, including 'strings', in the MCP tools list response using their configuration from commands.js.
    // Generate tools from commands configuration
    const specializedTools = Object.values(commands).map(cmd => ({
      name: cmd.name,
      description: cmd.description + (cmd.helpText ? '\n' + cmd.helpText : ''),
      inputSchema: zodToJsonSchema(cmd.schema),
    }));
    
    return {
      tools: [...basicTools, ...specializedTools],
    };
  • MCP tool call handler for specialized commands like 'strings': schema validation, command building, execution via terminalManager, and result formatting.
    // Check if this is a specialized command
    if (commands[name]) {
      try {
        const cmdConfig = commands[name];
        
        // Validate arguments against schema
        const validationResult = cmdConfig.schema.safeParse(args);
        if (!validationResult.success) {
          return {
            content: [{ 
              type: "text", 
              text: `Error: Invalid parameters for ${name} command.\n${JSON.stringify(validationResult.error.format())}`
            }],
            isError: true,
          };
        }
        
        // Build the command string
        const commandStr = cmdConfig.buildCommand(validationResult.data);
        console.error(`Executing specialized command: ${commandStr}`);
        
        // Execute the command via the terminal manager
        const result = await terminalManager.shellCommand(commandStr);
        console.error(`${name} command executed with PID: ${result.pid}, blocked: ${result.isBlocked}`);
        
        return {
          content: [{ type: "text", text: JSON.stringify(result) }],
        };
      } catch (error) {
        console.error(`Error executing ${name} command:`, error);
        return {
          content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true,
        };
      }
    }
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. It mentions what the tool does but lacks behavioral details such as permissions needed, rate limits, output format, or error handling. The examples hint at functionality but do not disclose operational traits.

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

Conciseness4/5

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

The description is front-loaded with the core purpose, followed by concise examples. Each sentence serves a purpose, though the example formatting could be slightly more structured. Overall, it is efficient with little waste.

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

Completeness3/5

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

Given no annotations and no output schema, the description is incomplete for a tool with 4 parameters. It covers basic usage but lacks details on behavioral aspects and output format, which are important for an extraction tool. It is adequate but has clear gaps.

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?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds minimal value by providing usage examples that illustrate parameter combinations but does not explain semantics beyond what the schema provides. Baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the specific action ('Extract printable strings') and resource ('from a file'), distinguishing it from sibling tools like 'hexdump' or 'objdump' which perform different analyses. The purpose is immediately apparent and specific.

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

Usage Guidelines3/5

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

The description provides example usage scenarios but does not explicitly state when to use this tool versus alternatives like 'file' or 'hexdump'. Usage is implied through examples rather than direct guidance on context or exclusions.

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/abdessamad-elamrani/MalwareAnalyzerMCP'

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