Skip to main content
Glama
abdessamad-elamrani

MalwareAnalyzerMCP

objdump

Analyze object files to display headers, disassemble code, or examine sections for malware investigation.

Instructions

Display information from object files

Example usage:

  • Display file headers: { "target": "suspicious.o" }

  • Disassemble code: { "target": "suspicious.exe", "disassemble": true }

  • Show section headers: { "target": "suspicious.exe", "headers": true }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget file or data to analyze
optionsNoAdditional command-line options
disassembleNoDisassemble executable sections
headersNoDisplay the contents of the section headers

Implementation Reference

  • Core handler logic for executing the 'objdump' tool: checks if specialized command, validates input using the tool's schema, builds the shell command using buildCommand, executes it via terminalManager.shellCommand, and returns the result.
    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,
        };
      }
  • serverMCP.js:113-121 (registration)
    Registers the 'objdump' tool (among specialized tools) in the MCP tools list by dynamically mapping from the commands configuration to include name, description, and inputSchema.
    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],
    };
  • Zod input schema definition for the 'objdump' tool, extending the base schema with optional boolean parameters for disassembly and headers.
    schema: baseCommandSchema.extend({
      disassemble: z.boolean().optional().describe("Disassemble executable sections"),
      headers: z.boolean().optional().describe("Display the contents of the section headers")
    }),
  • Helper function that constructs the specific 'objdump' shell command string based on provided arguments, adding appropriate flags or defaulting to file headers.
    buildCommand: (args) => {
      let options = args.options ? args.options : '';
      
      if (args.disassemble) {
        options += ' -d';
      }
      
      if (args.headers) {
        options += ' -h';
      }
      
      // Default to displaying file headers if no specific options provided
      if (!options && !args.disassemble && !args.headers) {
        options = ' -f';
      }
      
      return `objdump${options} ${args.target}`;
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions what the tool does (display information) but doesn't disclose behavioral traits like whether it's read-only, what permissions are needed, if it modifies files, error handling, or output format. The examples show parameter usage but lack broader context.

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 appropriately sized with a clear purpose statement followed by three concise examples. Each example earns its place by demonstrating different use cases. However, the structure could be slightly improved by front-loading more explicit guidance before the examples.

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 4 parameters, no annotations, and no output schema, the description is moderately complete. It covers the basic purpose and provides usage examples, but lacks information about behavioral aspects, error conditions, or what the output looks like. For a tool with this complexity, more context would be 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?

Schema description coverage is 100%, so the schema already documents all 4 parameters well. The description adds value through examples that illustrate how parameters like 'disassemble' and 'headers' work in practice, but doesn't provide additional semantic meaning beyond what the schema descriptions offer.

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 as 'Display information from object files' which is a specific verb+resource combination. However, it doesn't explicitly differentiate this from sibling tools like 'file' or 'hexdump' which might also analyze files, though the examples hint at specialized object file analysis.

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 usage examples that imply when to use this tool (for object file analysis, disassembly, or section header viewing), but doesn't explicitly state when to choose this over alternatives like 'file' for file type identification or 'hexdump' for raw hex output. The guidance is practical but not comparative.

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