Skip to main content
Glama

execute

Run Python code to chain multiple reverse-engineering tool calls. Use await invoke() to combine outputs, filter results, and handle multi-step pipelines or cross-database queries.

Instructions

Run Python code that chains tool calls. Use await invoke(name, params) to call tools; use return to produce output.

database is auto-injected into every invoke — omit it from params. Override per-call with explicit database for cross-database work.

When NOT to use execute

  • Single tool call → use the call meta-tool (or the direct tool if pinned).

  • N independent calls → use batch (lower overhead, per-item errors). → Otherwise, use the batch meta-tool for sequential multi-tool execution with per-item error collection and progress reporting.

  • Check if a tool has a built-in batch parameter first (e.g. get_strings filters=[...]).

When to use execute

Multi-step pipelines — chaining one tool's output into another:

decomp = await invoke("decompile_function", {"address": "0x1234"})
addrs = re.findall(r'sub_([0-9A-Fa-f]+)', decomp["pseudocode"])
xrefs = [await invoke("get_xrefs_to", {"address": f"0x{a}"}) for a in addrs]
return {"decomp": decomp, "xrefs": xrefs}

Cross-database parallel queries — use asyncio.gather with explicit database params. Same-database calls are serialized by the worker.

Reference

  • Blocked tools: open_database, close_database, wait_for_analysis, list_targets, and meta-tools (search_tools, get_schema, execute, batch, call) must be called directly. save_database and list_databases are allowed.

  • Addresses are strings: "0x401000", "4010a0", or symbol names.

  • filter_pattern is Python regex — use re.escape() for literals.

  • Available imports: asyncio, collections, functools, itertools, json, math, operator, re, struct, typing. No FS/network I/O.

  • Paginated results have items, total, offset, limit, has_more — always check has_more.

  • Use get_schema(tools=[...]) to look up parameter names and types.

  • Return only what you need — filter before returning to save context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython async code to execute tool calls via invoke(name, arguments)
databaseYesDatabase to target (stem ID from open_database). Available as `database` variable in code and auto-injected into invoke params. Individual calls can override by passing `database` explicitly.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

No annotations are provided, so the description carries full responsibility. It discloses important behavioral traits: database auto-injection, blocked tools, allowed imports, prohibition of FS/network I/O, paginated result shape, and the requirement to check has_more. This is far beyond a minimal summary.

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 long but every section earns its place: main usage, examples, exclusions, reference constraints. It is well-structured with clear headings and code blocks, ensuring an agent can quickly extract the rules that matter.

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

Completeness5/5

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

Given the tool's complexity and the absence of annotations and output schema, the description is exceptionally complete. It covers when to use, when not to use, parameter behavior, execution environment, tool-blocking rules, and result conventions. Nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds substantial meaning: database is auto-injected into invoke and can be overridden, code is Python async code, plus practical details like address formats, Python regex for filter_pattern, and available imports. This greatly aids correct invocation.

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 opens with a specific verb and resource: 'Run Python code that chains tool calls.' It clearly distinguishes itself from siblings by positioning execute as the multi-step pipeline meta-tool, with explicit contrast to call and batch.

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

Usage Guidelines5/5

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

The description has a dedicated 'When NOT to use execute' section naming alternatives (call, batch, built-in batch parameters) and a 'When to use execute' section with concrete scenarios (multi-step pipelines, cross-database parallel queries). This gives the agent unambiguous routing guidance.

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