Expand description
Cross-language wire DTOs for the M1a read tools (spec §3). These are the worker’s response shapes;
the server canonicalizes address strings (via address::AddressCanonicalizer) before returning
them to the MCP client, but the wire form carries whatever space:offset the worker emits.
Schema-stability contract (spec §3.5): these shapes are a BASELINE. Later milestones may only ADD keys; renaming/retyping/removing an M1a field requires a NEW MCP tool name.
Structs§
- Address
Info describe_addressresult (spec §3.x): a TOTAL address -> what-is-here point lookup, the dual ofresolve_symbol. An unmapped/unparseable address is a valid answer (mapped: false), never an error.addressechoes the request (rawspace:offsetwhen mapped; the handler canonicalizes it).- Address
Symbol - The primary symbol at an address, from
describe_address.kindis a lowercase Ghidra classification string (NOT a Rust enum), mirroringSymbol::kind. - Attach
Result - The
attach_program/worker_infoshared result: the worker reports the attached program’s address geometry so the server can build anAddressCanonicalizerfor it (spec §3.2 + §6). This is strictly-additive to the M0{attached}shape. - Call
Edge - One call-graph neighbor of a function (spec §3.3).
addressis a rawspace:offsetstring as emitted by the worker; the server re-renders it throughAddressCanonicalizerbefore it reaches the agent.external: truemarks an imported-DLL thunk with no decompilable body (spec §3.3 round-7 seat-3) — the agent identifies it by name, never feeds it back toinspect_function. - Comment
Entry - One comment surfaced by
inspect_function(M2b read-back tidy).addressis a rawspace:offsetstring as emitted by the worker; the handler canonicalizes it alongside the otherFunctionContextaddresses.kindis the comment channel (eol|pre|post|plate|repeatable);commentis the text. - Comment
Result - Result of the
commentwrite tool (M2b §3.1).previous_commentis present only when a prior non-empty comment was overwritten or cleared.addressis canonicalized by the rmcp handler. - Containing
Function - The function containing an address, from
describe_address(spec §3.x).entry_pointis a rawspace:offsetstring as emitted by the worker; the handler canonicalizes it. - Data
Item - One defined data instance from
list_data_items(spec §3.x).addressis a rawspace:offsetstring as emitted by the worker; the handler canonicalizes it.nameis the listing label when one is present (else absent);valueis present only when the worker could cheaply render it. - DataRef
- One from-data reference gathered from
inspectFunction’s body (Task 16).addressis a rawspace:offsetstring as emitted by the worker; the handler canonicalizes it alongside the otherFunctionContextaddresses.nameis the primary symbol at the target address when one exists.ref_typeis the GhidraRefTypename (e.g. “DATA”, “READ”, “WRITE”). - Data
Type Info get_datatyperesult (spec §3.x): looks up a data type DEFINITION by name.membersis present for struct/union kinds,valuesfor enum kinds; both absent for any other kind (e.g. a typedef or built-in scalar), which reports only name/kind/size.- Data
Type Member - One field of a struct/union data type, from
get_datatype(spec §3.x).type_serializes as the wire keytype(a Rust keyword-adjacent rename, not a shape change). - Disassembly
get_disassemblyresult (paginated).totalis the EXACT instruction count of the resolved function’s body (cheap to compute for one bounded function — unlike the filtered-table tools).- Enum
Value - One named value of an enum data type, from
get_datatype.valueis a String (not a number): Ghidra enum constants can be full 64-bit values, and a bare JSON number would lose precision for the high end of that range (spec §10.8) — the agent must parse it itself. - Function
Context - The result of
inspect_function(spec §3.3).cis capped from the top bymax_c_lines(signature + decls always intact — spec §3.4);c_truncatedsignals the body was longer. - Function
Summary - One row of
find_functions(spec §3.1): the cheap metadata subset ofFunctionContext— NO decompiled C, NO edges.addressfields are rawspace:offset; the handler canonicalizes them. - Instruction
- One instruction row from
get_disassembly.addressis a rawspace:offsetstring as emitted by the worker; the handler canonicalizes it.bytesis lowercase hex.commentsmirrors the wire object keyed by comment channel (eol|pre|post|plate|repeatable), present only when a comment exists at this address (M2b read-back tidy — aligned to the wire in M2c Task 0.1). - List
Data Items list_data_itemsresult (paginated).totalpresent only for cheap exact counts (§3.0) — the M1b worker does not emit it today, so it always deserializes as absent/None.- List
Functions find_functionsresult (spec §3.1).totalpresent only for cheap exact counts (§3.0).- List
Project Programs - The full
list_project_programsresult (spec §3.1, paginated). - List
Segments list_segmentsresult (spec §3.x): the full memory map. NOT paginated — segment counts are small.- List
Strings list_stringsresult (spec §3.4, paginated).totalpresent only for cheap exact counts (§3.0).- List
Symbols list_symbolsresult (spec §3.3, paginated).totalpresent only for cheap exact counts (§3.0).- Local
Entry - One local variable of a function, sourced from the decompiler
HighFunction(so thenamematches thecbody the agent reads) — NOT the Program-DB listing.storage(stack:-0x18,EAX:4,unique:…) is the STABLE primary handle aset_localwrite keys on;nameis a convenience selector that the decompiler may silently re-derive across edits.kind∈stack|register|unique|othertells the agent which handles are trustworthy across edits.type_serializes as the wire keytype, mirroringParamEntry. - Param
Entry - One parameter of a function’s structured signature (read side of
inspect_function.prototype; M2c Task 0.2).nameis Ghidra’s DB parameter name (auto-namedparam_1…when the binary has no symbol);type_serializes as the wire keytype. Mirrors the write-sideSetPrototypeArgs.paramselement so a read prototype can be edited and bounced straight back toset_prototype. - Program
Entry - One row of
list_project_programs(spec §3.1).program_pathis the absolute/-VFS path used byattach_program.language_id/sizecome from cheapDomainFilemetadata (may be absent). - Prototype
- The current signature of a function, structured (read side; M2c Task 0.2). Sourced from the Program
DB
Function.getSignature()— NOT the decompilerHighFunction, which infers params not locked in the DB (the CAS/write only operate on the DB signature). MirrorsSetPrototypeArgsexactly so the write-loop closes from one read: inspect → mutate one field → set_prototype. - Read
Bytes read_bytesresult (spec §3.x): a raw byte dump ataddress(which echoes the address actually read, i.e.address + offset).bytesis lowercase hex,lengththe number of bytes actually returned (may be less than requested if clamped).truncatedis true when the requested length was clamped down to the 4096-byte cap.- Reference
- One cross-reference row from
get_xrefs(spec §3.x).from_address/to_addressare rawspace:offsetstrings as emitted by the worker; the handler canonicalizes both.ref_typeis the GhidraRefTypename (e.g. “CALL”, “DATA”, “READ”).from_functionis present only when the reference’s source address falls inside a defined function. - Rename
Result - Result of the
renamewrite tool (spec §3.4).previous_nameis present only forstatus="renamed". Theaddressis the raw worker string; the rmcp handler canonicalizes it (spec §3.4). - Resolve
Symbol resolve_symbolresult (spec §3.2): every symbol matching the requested name.- Segment
- One memory block from
list_segments(spec §3.x).start/endare rawspace:offsetstrings as emitted by the worker; the handler canonicalizes both. - SetDatatype
Result - Result of the
set_datatypewrite tool (M2b §3.2).statusis"set"|"cleared"|"already_applied";datatypeis the final resolved display name ("undefined"after a clear).previous_datatypeis present only when a prior type was replaced/cleared.addressis canonicalized by the rmcp handler. - SetLocal
Result - Result of the
set_localwrite tool (M2d §4.1).status∈set|renamed|retyped|already_applied(a combined type+name change ⇒set).storageis the canonical handle that was edited (retry-stable for stack locals);name/typeare the NEW current values.previous_nameis present only whennew_namewas given AND the name actually changed;previous_typeonly whennew_typewas given AND the type actually changed (panel R1-Seat2).functionechoes the function name.type_serializes as the wire keytype. - SetPrototype
Result - Result of the
set_prototypewrite tool (M2c §3).statusis"set"|"already_applied";signatureis the NEW canonical DB prototype string;previous_signatureis present only when a prior signature was overwritten.address(the function entry point) is canonicalized by the rmcp handler.nameechoes the function name. - String
Item - One row of
list_strings(spec §3.4).addressis a rawspace:offsetstring as emitted by the worker; the handler canonicalizes it.encodingis the Ghidra data type name (e.g. “string”, “unicode”). - Symbol
- One symbol row, shared by resolve_symbol and list_symbols (spec §3.2/§3.3). Uniform shape; optional
fields absent when N/A.
kindis a lowercase Ghidra classification string (NOT a Rust enum). - Symbol
Candidate - One ambiguous-symbol candidate, carried in an
AMBIGUOUS_SYMBOLerror’sdetails.candidates(spec §6). The agent re-callsinspect_functionwith the disambiguatingaddress. - Xrefs
get_xrefsresult (paginated).totalpresent only for cheap exact counts (§3.0).