Skip to main content
Glama

Execute a Python file in the worker

py_exec_file

Execute a Python script file in IDA and return stdout/stderr, using one shared globals dict so top-level definitions are visible to all code in large scripts.

Instructions

Execute a Python script file in IDA context and return stdout/stderr.

Unlike py_eval, this runs the entire file with exec() using a single shared globals dict (no locals split), so top-level definitions are visible to all code in the script. Handles large scripts that would be unwieldy as inline code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to a Python script to execute
instance_idNoOptional database instance id. If omitted, use the current target.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
stderrYes
stdoutYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv20261008.0.1

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses exec() semantics with a single shared globals dict (top-level definitions visible to all code) and the stdout/stderr return channel, but says nothing about side effects, permissions, or the fact that arbitrary Python in an IDA context can mutate the open database.

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?

Three tight sentences, front-loaded with the action and return value, then the differentiation and the practical rationale. No filler, though the middle sentence is slightly dense.

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?

An output schema exists, so return format needn't be restated, and the description covers purpose and execution semantics. However, for a tool that runs arbitrary Python against a database with no annotations, it omits any caution about mutation or environmental side effects, leaving a meaningful gap.

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 file_path (absolute path) and instance_id (optional target instance) are fully documented in the schema. The description adds no parameter-level detail beyond that, which is the expected baseline when the schema does the work.

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?

States a specific verb and resource ('Execute a Python script file in IDA context') and explicitly distinguishes itself from the py_eval sibling by contrasting execution semantics. It does not address the other close-looking sibling execute_python, so differentiation is strong but not exhaustive.

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

Usage Guidelines4/5

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

Gives a clear selection rule ('Handles large scripts that would be unwieldy as inline code') and names py_eval as the alternative for the opposite case. It stops short of explaining when-not-to-use or how to choose against execute_python, which also appears in the sibling list.

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