Skip to main content
Glama
I-CAN-hack
by I-CAN-hack

clear

Remove specified program metadata such as instructions, symbols, comments, and references from selected addresses or ranges in a Ghidra project.

Instructions

Clear selected program metadata using Ghidra's Clear With Options command.

If `clear_types` is omitted or empty, every clear option is enabled,
matching a full Clear With Options selection. Otherwise, only the requested
`clear_types` are enabled. Supported values are:
`instructions`, `data`, `symbols`, `comments`, `properties`, `functions`,
`registers`, `equates`, `user_references`, `analysis_references`,
`import_references`, `default_references`, and `bookmarks`. `all` expands
to every clear type.

With a single `target`, this clears the code unit containing that address,
matching Clear With Options with no listing selection. With `end`, `length`,
or `ranges`, it clears over that selection.

Args:
    program: Required Ghidra project path or name to target.
    clear_types: Clear option names to enable exactly. Omit to clear all
        supported types.
    target: Address, exact label, or function name. Required unless
        `ranges` is supplied.
    end: Inclusive end address for a contiguous selection.
    length: Byte length for a contiguous selection starting at `target`.
    ranges: Optional list of range objects, each with `start` plus optional
        `end` or `length`, for non-contiguous selections.
    timeout: Bridge execution timeout in seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
lengthNo
rangesNo
targetNo
programYes
timeoutNo
clear_typesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behaviors: all clear types enabled if clear_types omitted, supported values, single-target vs range behavior, and the fact that a single target clears the containing code unit. It does not explicitly state irreversibility or side effects, but the 'clear' semantics are reasonably transparent for a metadata-removal tool.

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 structured and front-loaded with purpose and behavior, followed by an Args list. It is longer than minimal but every sentence adds necessary detail, such as the list of clear types and selection semantics. No redundancy is present, though it could be slightly tightened without losing information.

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 (7 params, 1 required) and zero schema coverage, the description fully specifies all parameters, valid values, and edge cases. It explains selection behavior and default handling, and the presence of an output schema covers return-value expectations. No critical information for correct invocation 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 description coverage is 0%, so the description must fully compensate. It explains each parameter: program, clear_types with supported values and expansion of 'all', target required unless ranges supplied, end/length for contiguous selections, ranges for non-contiguous, and timeout. This adds substantial meaning beyond the raw schema, detailing valid values and selection logic.

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 tool clears selected program metadata using Ghidra's Clear With Options command, with a specific verb and resource. It distinguishes from siblings like rename or comment by focusing on metadata removal. The purpose is unambiguous and not a tautology.

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 explains how to use the tool (single target vs ranges, clear_types omission semantics) but does not explicitly mention when to choose it over alternatives or when not to use it. It provides clear operational context but lacks exclusionary guidance or sibling comparison, which is a gap given the tool's destructive nature.

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