Skip to main content
Glama
droidasc-mcp

droidasc-mcp

by cnlnn

asc_query_dex_session

Query immutable Android DEX sessions to inspect classes, methods, fields, strings, references, and call graphs with provenance and paginated results.

Instructions

Query an immutable DEX session in a supervised worker, with original provenance.

Native instruction/declaration queries need no JVM or JADX; Smali uses ASC. search_refs combines literal owner/name/prototype filters without global preprocessing. find_string_refs accepts a literal value and returns const-string/jumbo use sites. target_descriptor optionally filters exact prototypes/field types. find_method_refs/get_method_calls return declared instruction targets, not runtime dispatch. method_descriptor is the full DEX class->name(args)return identity. Or supply exact class_name and method_name for a declared method; target_descriptor optionally selects its prototype. Ambiguous names fail without choosing an overload. find_field_refs requires field_descriptor (Lpkg/C;->name:I). field_access filters reads/writes; inheritance and reflective accesses are not resolved. build_xref_index persists an atomic static index for this session's lifetime. get_call_graph uses bounded frontiers or an index for multi-hop static exploration. Inspect truncation_reasons and unresolved_sites; graph edges are declared operands. An optional configured durable cache restores matching indexes across server restarts. find_type_refs with type_relation=operand scans explicit type operands without an index, using exact or literal substring type_match. Other type scopes build/reuse the index. instruction includes member-type and catch relations; exact matching preserves arrays. search_members scans declarations or reuses an existing index; kind=method/field. value is a case-sensitive literal substring of the full descriptor, not regex. class_name restricts exact owner. search_strings scans DEX string-pool values using a case-sensitive literal value, not instruction use sites. Identical discovery and non-indexed reference pages reuse a bounded session cache. Reference pages can stop at the byte budget before limit; continue with next_offset. reference_format=grouped returns groups with matches/evidence for instruction references. In grouped format limit counts caller groups; total/offset/returned_sites count sites. Continue with next_cursor and identical selectors; a large caller may span pages. source_format=auto uses ASC exact-method Smali, never JADX. source_format=java explicitly selects the optional compatibility backend.

Input Schema

NameRequiredDescriptionDefault
kindNoReference category; search_members accepts method or field onlystring
depthNoHop bound; bounded frontiers or an on-demand calls-only index.
limitNoMaximum result page size in rows or source lines, server-capped
valueNoLiteral value (classes: Dalvik or dotted); exact extends/impl parent
cursorNoGrouped next_cursor for the same session/query; leave offset at zero
offsetNoZero-based result offset; graph traversal requires zero
prefixNoLiteral class/package prefix, case-sensitive
threadsNoPositive ASC worker count; requested values above 32 are capped
directionNoGraph direction; edges retain caller-to-callee orientation.both
max_edgesNoGraph call-site budget; repeated calls remain separate edges.
max_nodesNoCall-graph node budget including the root.
operationNoSession operation; graph frontiers and type indexes run on demandinfo
class_nameNoExact owner class; for legacy fuzzy references, a literal owner substring
debug_infoNoInclude debug line/local metadata for explicit method Smali only
session_idYesImmutable open DEX session ID returned by an open tool
type_matchNoCase-sensitive type matching; substring requires type_relation=operandexact
fuzzy_classNoLegacy owner substring matching; exact member tools require false
method_nameNoExact declared method name with class_name, instead of method_descriptor; overloads require target_descriptor
field_accessNoInstruction field-access filter, for find_field_refsall
member_matchNoLiteral identity or name; search_refs also accepts exact_name and prototypedescriptor
source_formatNoExact method source; auto has explicit fallback diagnosticsauto
type_relationNooperand selects explicit type operands without an index; instruction includes member types and catchesall
case_sensitiveNoLiteral discovery matching case; false ignores case
type_descriptorNoDEX type including array dimensions; operand scope also accepts dotted names or literal substrings
field_descriptorNoFull field identity: Lpkg/C;->name:type
reference_formatNoReference rows or caller groups with complete evidence; default flatflat
method_descriptorNoFull method identity: Lpkg/C;->name(args)return; preserves overloads
target_descriptorNoExact prototype for method_name selection; search_refs prototype or field-type filter

Output Schema

NameRequiredDescriptionDefault
codeNo
depthNo
edgesNo
indexNo
itemsNo
limitNo
nodesNo
totalNo
formatNo
groupsNo
moduleNo
offsetNo
sourceNo
statusYes
backendNo
messageNo
sourcesNo
apk_pathNo
coverageNo
has_moreNo
input_idNo
dex_entryNo
directionNo
max_edgesNo
max_nodesNo
span_unitNo
truncatedNo
apk_sha256No
class_nameNo
edge_countNo
input_kindNo
limit_unitNo
node_countNo
session_idNo
source_endNo
superclassNo
total_unitNo
type_matchNo
edge_countsNo
field_countNo
limitationsNo
method_nameNo
next_cursorNo
next_offsetNo
query_cacheNo
scan_errorsNo
access_flagsNo
has_manifestNo
method_countNo
source_startNo
stored_bytesNo
artifact_pathNo
dynamic_sitesNo
source_sha256No
type_relationNo
engine_versionNo
returned_sitesNo
artifact_sha256No
backend_versionNo
candidate_countNo
cleanup_pendingNo
page_limited_byNo
scanned_methodsNo
type_descriptorNo
definition_countNo
field_descriptorNo
idle_ttl_secondsNo
reference_formatNo
selected_modulesNo
unresolved_sitesNo
member_referencesNo
method_descriptorNo
truncation_reasonsNo
unresolved_matchesNo
reference_semanticsNo
response_byte_limitNo
methods_without_codeNo
reserved_index_bytesNo
runtime_completenessNo
scanned_instructionsNo
hierarchy_cycle_detectedNo
instruction_scan_completeNo
runtime_target_resolutionNo
unresolved_sites_truncatedNo
traversal_complete_within_depthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed29 schema fields changedv0.2.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 1024,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Grouped next_cursor for the same session/query; leave offset at zero",
      +  "title": "Cursor"
      +}
    • addedInput schema / properties / reference_format
      Added value: +{
      +  "default": "flat",
      +  "description": "Reference rows or caller groups with complete evidence; default flat",
      +  "enum": [
      +    "flat",
      +    "grouped"
      +  ],
      +  "title": "Reference Format",
      +  "type": "string"
      +}
    • changedInput schema / properties / type_descriptor / description
      Previous value: -"Exact DEX type including array dimensions, for find_type_refs"New value: +"DEX type including array dimensions; operand scope also accepts dotted names or literal substrings"
    • addedInput schema / properties / type_match
      Added value: +{
      +  "default": "exact",
      +  "description": "Case-sensitive type matching; substring requires type_relation=operand",
      +  "enum": [
      +    "exact",
      +    "substring"
      +  ],
      +  "title": "Type Match",
      +  "type": "string"
      +}
    • changedInput schema / properties / type_relation / description
      Previous value: -"Static type relation filter applied before pagination"New value: +"operand selects explicit type operands without an index; instruction includes member types and catches"
    • changedInput schema / properties / type_relation / enum
      Previous value: -[
      -  "all",
      -  "instruction",
      -  "declaration",
      -  "annotation"
      -]New value: +[
      +  "all",
      +  "instruction",
      +  "declaration",
      +  "annotation",
      +  "operand"
      +]
    • addedOutput schema / $defs / DexRow / properties / target_index
      Added value: +{
      +  "title": "Target Index",
      +  "type": "integer"
      +}
    • addedOutput schema / $defs / ReferenceGroup
      Added value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "caller": {
      +      "title": "Caller",
      +      "type": "string"
      +    },
      +    "dex_entry": {
      +      "title": "Dex Entry",
      +      "type": "string"
      +    },
      +    "evidence": {
      +      "items": {
      +        "$ref": "#/$defs/DexRow"
      +      },
      +      "title": "Evidence",
      +      "type": "array"
      +    },
      +    "matches": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "title": "Matches",
      +      "type": "array"
      +    },
      +    "offset_unit": {
      +      "title": "Offset Unit",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "target_field": {
      +      "enum": [
      +        "callee",
      +        "field_descriptor",
      +        "value",
      +        "type_descriptor"
      +      ],
      +      "title": "Target Field",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "dex_entry",
      +    "caller",
      +    "target_field",
      +    "matches",
      +    "evidence"
      +  ],
      +  "title": "ReferenceGroup",
      +  "type": "object"
      +}
    • addedOutput schema / $defs / Source / properties / container_sha256
      Added value: +{
      +  "title": "Container Sha256",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / Source / properties / container_size_bytes
      Added value: +{
      +  "title": "Container Size Bytes",
      +  "type": "integer"
      +}
    • addedOutput schema / $defs / Source / properties / logical_header_offset
      Added value: +{
      +  "title": "Logical Header Offset",
      +  "type": "integer"
      +}
    • addedOutput schema / $defs / Source / properties / logical_size_bytes
      Added value: +{
      +  "title": "Logical Size Bytes",
      +  "type": "integer"
      +}
    • addedOutput schema / $defs / Source / properties / module
      Added value: +{
      +  "title": "Module",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / Source / properties / normalization
      Added value: +{
      +  "title": "Normalization",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / Source / properties / original_dex_version
      Added value: +{
      +  "title": "Original Dex Version",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / Source / properties / snapshot_entry
      Added value: +{
      +  "title": "Snapshot Entry",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / Source / properties / stored_size_bytes
      Added value: +{
      +  "title": "Stored Size Bytes",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / groups
      Added value: +{
      +  "items": {
      +    "$ref": "#/$defs/ReferenceGroup"
      +  },
      +  "title": "Groups",
      +  "type": "array"
      +}
    • addedOutput schema / properties / limit_unit
      Added value: +{
      +  "const": "caller_groups",
      +  "title": "Limit Unit",
      +  "type": "string"
      +}
    • addedOutput schema / properties / module
      Added value: +{
      +  "title": "Module",
      +  "type": "string"
      +}
    • addedOutput schema / properties / next_cursor
      Added value: +{
      +  "title": "Next Cursor",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • removedOutput schema / properties / page_limited_by / const
      Removed value: -"response_bytes"
    • addedOutput schema / properties / page_limited_by / enum
      Added value: +[
      +  "response_bytes",
      +  "caller_groups"
      +]
    • addedOutput schema / properties / reference_format
      Added value: +{
      +  "const": "grouped",
      +  "title": "Reference Format",
      +  "type": "string"
      +}
    • addedOutput schema / properties / returned_sites
      Added value: +{
      +  "title": "Returned Sites",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / selected_modules
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Selected Modules",
      +  "type": "array"
      +}
    • addedOutput schema / properties / total_unit
      Added value: +{
      +  "const": "reference_sites",
      +  "title": "Total Unit",
      +  "type": "string"
      +}
    • addedOutput schema / properties / type_match
      Added value: +{
      +  "enum": [
      +    "exact",
      +    "substring"
      +  ],
      +  "title": "Type Match",
      +  "type": "string"
      +}
    • addedOutput schema / properties / type_relation
      Added value: +{
      +  "title": "Type Relation",
      +  "type": "string"
      +}
  2. Changed19 schema fields changedv0.2.4
    • changedInput schema / properties / limit / description
      Previous value: -"Positive result page size in rows or source lines, server-capped"New value: +"Maximum result page size in rows or source lines, server-capped"
    • removedOutput schema / $defs / DexRow / properties / instruction_offset / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / $defs / DexRow / properties / instruction_offset / type
      Added value: +[
      +  "integer",
      +  "null"
      +]
    • removedOutput schema / $defs / DexRow / properties / offset_unit / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / $defs / DexRow / properties / offset_unit / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / $defs / DexRow / properties / target_dex_entry / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / $defs / DexRow / properties / target_dex_entry / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / $defs / GraphNode / properties / dex_entry / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / $defs / GraphNode / properties / dex_entry / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / $defs / GraphNode / properties / without_code / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / $defs / GraphNode / properties / without_code / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
    • addedOutput schema / $defs / QueryCache / properties / budget_bytes
      Added value: +{
      +  "title": "Budget Bytes",
      +  "type": "integer"
      +}
    • addedOutput schema / $defs / QueryCache / properties / stored_bytes
      Added value: +{
      +  "title": "Stored Bytes",
      +  "type": "integer"
      +}
    • removedOutput schema / properties / next_offset / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / next_offset / type
      Added value: +[
      +  "integer",
      +  "null"
      +]
    • addedOutput schema / properties / page_limited_by
      Added value: +{
      +  "const": "response_bytes",
      +  "title": "Page Limited By",
      +  "type": "string"
      +}
    • addedOutput schema / properties / response_byte_limit
      Added value: +{
      +  "title": "Response Byte Limit",
      +  "type": "integer"
      +}
    • removedOutput schema / properties / superclass / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / superclass / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  3. Addedv0.2.3

TDQS

A3.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false on a tool named 'query', and the description explains why: build_xref_index 'persists an atomic static index for this session's lifetime' and an optional durable cache restores indexes across restarts. It also discloses failure modes and limits beyond the schema — truncated pages stopping 'at the byte budget before limit', ambiguity failing rather than guessing an overload, and unresolved_sites/truncation_reasons to inspect.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in sentence one, but the remainder is an unstructured wall of one-clause statements hopping between operations with no headings or grouping. Given 23 operations some length is warranted, yet several lines (e.g., the instruction/catch and array-matching note) read as spec fragments rather than selection guidance.

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 shapes need not be explained. However, for a dispatcher with 23 enum values, many operations (info, list_classes, get_class_source, list_methods, search_classes, get_class_outline, get_class_hierarchy, search_method_bodies, disassemble_method, get_class_source_metadata) are never described anywhere except the bare enum list, so the description is only partially complete for the tool's actual surface.

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 coverage is 100%, so the baseline is 3. The description does add some meaning beyond the schema — grouped format making 'limit counts caller groups' while 'total/offset/returned_sites count sites', and source_format=auto never falling back to JADX — but most of the 28 parameters get no mention, and the added detail is selective rather than compensatory.

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?

The opening sentence names a specific verb and resource ('Query an immutable DEX session in a supervised worker, with original provenance') and the body enumerates many of the 23 operations it dispatches. It stops short of differentiating this multi-op tool from overlapping siblings such as asc_list_classes, asc_get_class_source, and asc_find_refs, so an agent cannot tell from the text alone which entry point to pick.

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?

There is substantial operation-level guidance ('find_field_refs requires field_descriptor', 'Or supply exact class_name and method_name... Ambiguous names fail', 'search_strings scans DEX string-pool values ... not instruction use sites'), which is genuinely useful. But the tool-selection question — when to use this dispatcher versus the dedicated sibling tools that expose the same operations — is never addressed, leaving the most important routing decision to inference.

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