Skip to main content
Glama

Inspect Python Frozen Binary

inspect_python_frozen_binary
Idempotent

Analyze PyInstaller frozen Python executables and .pyc files without executing them or needing Python. Recover MEI cookies, Python version, entry scripts, bundled modules, and code-object summaries.

Instructions

Inspect a frozen Python executable (PyInstaller CArchive/PKG/PYZ ELF, PE, or Mach-O) or standalone .pyc bytecode file in pure TypeScript without executing target code or requiring a Python runtime. Recovers PyInstaller MEI cookies, Python version, entry scripts, bundled modules, native extensions, CArchive table-of-contents entries, and .pyc marshal code object summaries (names, varnames, string constants, and imported module names).

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "/artifacts/frozen_app",
      "max_toc_entries": 1000,
      "max_code_objects": 200
    },
    "name": "inspect_python_frozen_binary"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute filesystem path to a frozen Python executable (PyInstaller ELF/PE/Mach-O) or standalone .pyc bytecode file.
max_entriesNoOptional alias for max_toc_entries: maximum number of CArchive/PYZ entries to return.
max_stringsNoOptional cap on string constants returned per code object.
max_toc_entriesNoMaximum number of PyInstaller CArchive/PYZ table-of-contents entries to return (default 1000).
max_code_objectsNoMaximum number of Python marshal code objects to return when inspecting .pyc bytecode (default 200).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Adds real behavioral context beyond the annotations: analysis is done in pure TypeScript, target code is never executed, and no Python runtime is required — meaningful safety and environment facts for a binary-analysis agent. The remaining gaps are failure behavior (what happens for a non-PyInstaller file or truncated archive) and any size/time limits; there is also mild tension with readOnlyHint=false, though the description's non-execution claim concerns the target artifact rather than the host, so it is not a contradiction.

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?

Two front-loaded sentences: the first establishes what it inspects and the key constraint (no execution, no runtime), the second enumerates recoverables. Dense but readable; the second sentence is a long comma-chained list that could be tightened, but no sentence is filler.

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

Completeness4/5

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

For a read-oriented inspection tool with 5 parameters, one required, no output schema, and modest annotation coverage, the description supplies the input domain, environment preconditions, and a usable summary of return contents. Only error-path and truncation semantics are unaddressed, which is a minor gap rather than a blocking one.

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 every parameter including the max_toc_entries alias max_entries is already documented in structured data. The description only indirectly maps to the caps by naming TOC entries, code objects and string constants as recoverables, but adds no syntax, default, or interaction guidance (e.g., that max_entries aliases max_toc_entries). 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?

States a specific verb (Inspect) plus a precisely bounded resource: PyInstaller CArchive/PKG/PYZ executables across ELF, PE and Mach-O, and standalone .pyc files. It also enumerates concrete recoverables (MEI cookies, Python version, entry scripts, TOC entries, marshal code object summaries), which separates it from generic siblings like inspect_binary_layout or inspect_go_binary without needing their schemas.

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 input domain implicitly routes usage — an agent can infer this is the tool for frozen Python artifacts and .pyc files rather than Go/Rust binaries. However there is no explicit when-to-use statement, no mention of when to prefer the generic binary tools instead (e.g., non-Python executables), and no stated prerequisites such as the path needing to be readable on the host filesystem.

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

Deploy Server

Other Tools