Skip to main content
Glama
droidasc-mcp

droidasc-mcp

by cnlnn

asc_get_class_source

Read-only

Locate and decompile one Android APK class, returning a bounded page of source lines for targeted code inspection.

Instructions

Locate and decompile one class, returning a bounded page of source lines.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum result page size in rows or source lines, server-capped
offsetNoZero-based result offset; graph traversal requires zero
backendNoEngine; rust_asc is opt-in and reports unverified coveragedroidasc
threadsNoPositive ASC worker count; requested values above 32 are capped
apk_pathYesAPK file path within configured allowed roots
class_nameYesExact class descriptor or Java dotted class name

Output Schema

NameRequiredDescriptionDefault
xmlNo
codeNo
kindNo
itemsNo
limitNo
totalNo
moduleNo
offsetNo
sourceNo
statusNo
backendNo
messageNo
sourcesNo
apk_pathNo
coverageNo
has_moreNo
input_idNo
truncatedNo
apk_sha256No
class_nameNo
session_idNo
limitationsNo
next_offsetNo
artifact_pathNo
artifact_sha256No
backend_versionNo
selected_modulesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.2.5
    • addedOutput schema / $defs / DexRow / properties / target_index
      Added value: +{
      +  "title": "Target Index",
      +  "type": "integer"
      +}
    • 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 / module
      Added value: +{
      +  "title": "Module",
      +  "type": "string"
      +}
    • addedOutput schema / properties / selected_modules
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Selected Modules",
      +  "type": "array"
      +}
  2. Changed9 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 / properties / next_offset / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / next_offset / type
      Added value: +[
      +  "integer",
      +  "null"
      +]
  3. Changed9 schema fields changedv0.2.3
    • addedInput schema / properties / apk_path / description
      Added value: +"APK file path within configured allowed roots"
    • addedInput schema / properties / backend
      Added value: +{
      +  "default": "droidasc",
      +  "description": "Engine; rust_asc is opt-in and reports unverified coverage",
      +  "enum": [
      +    "droidasc",
      +    "rust_asc"
      +  ],
      +  "title": "Backend",
      +  "type": "string"
      +}
    • addedInput schema / properties / class_name / description
      Added value: +"Exact class descriptor or Java dotted class name"
    • addedInput schema / properties / limit / description
      Added value: +"Positive result page size in rows or source lines, server-capped"
    • addedInput schema / properties / offset / description
      Added value: +"Zero-based result offset; graph traversal requires zero"
    • addedInput schema / properties / threads / description
      Added value: +"Positive ASC worker count; requested values above 32 are capped"
    • addedOutput schema / $defs
      Added value: +{
      +  "DexRow": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "access": {
      +        "enum": [
      +          "read",
      +          "write"
      +        ],
      +        "title": "Access",
      +        "type": "string"
      +      },
      +      "access_flags": {
      +        "title": "Access Flags",
      +        "type": "integer"
      +      },
      +      "call_site_prototype": {
      +        "title": "Call Site Prototype",
      +        "type": "string"
      +      },
      +      "callee": {
      +        "title": "Callee",
      +        "type": "string"
      +      },
      +      "caller": {
      +        "title": "Caller",
      +        "type": "string"
      +      },
      +      "class_name": {
      +        "title": "Class Name",
      +        "type": "string"
      +      },
      +      "descriptor": {
      +        "title": "Descriptor",
      +        "type": "string"
      +      },
      +      "detail": {
      +        "title": "Detail",
      +        "type": "string"
      +      },
      +      "dex": {
      +        "title": "Dex",
      +        "type": "string"
      +      },
      +      "dex_entry": {
      +        "title": "Dex Entry",
      +        "type": "string"
      +      },
      +      "dispatch_kind": {
      +        "title": "Dispatch Kind",
      +        "type": "string"
      +      },
      +      "field_descriptor": {
      +        "title": "Field Descriptor",
      +        "type": "string"
      +      },
      +      "has_code": {
      +        "title": "Has Code",
      +        "type": "boolean"
      +      },
      +      "instruction": {
      +        "title": "Instruction",
      +        "type": "string"
      +      },
      +      "instruction_offset": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Instruction Offset"
      +      },
      +      "kind": {
      +        "title": "Kind",
      +        "type": "string"
      +      },
      +      "matched": {
      +        "title": "Matched",
      +        "type": "string"
      +      },
      +      "method": {
      +        "title": "Method",
      +        "type": "string"
      +      },
      +      "method_descriptor": {
      +        "title": "Method Descriptor",
      +        "type": "string"
      +      },
      +      "name": {
      +        "title": "Name",
      +        "type": "string"
      +      },
      +      "offset_unit": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Offset Unit"
      +      },
      +      "opcode": {
      +        "title": "Opcode",
      +        "type": "string"
      +      },
      +      "parameter_types": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "title": "Parameter Types",
      +        "type": "array"
      +      },
      +      "raw": {
      +        "title": "Raw",
      +        "type": "string"
      +      },
      +      "reason": {
      +        "title": "Reason",
      +        "type": "string"
      +      },
      +      "relation": {
      +        "title": "Relation",
      +        "type": "string"
      +      },
      +      "return_type": {
      +        "title": "Return Type",
      +        "type": "string"
      +      },
      +      "source": {
      +        "title": "Source",
      +        "type": "string"
      +      },
      +      "storage": {
      +        "enum": [
      +          "static",
      +          "instance"
      +        ],
      +        "title": "Storage",
      +        "type": "string"
      +      },
      +      "string": {
      +        "title": "String",
      +        "type": "string"
      +      },
      +      "string_index": {
      +        "title": "String Index",
      +        "type": "integer"
      +      },
      +      "target": {
      +        "title": "Target",
      +        "type": "string"
      +      },
      +      "target_dex_entry": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "title": "Target Dex Entry"
      +      },
      +      "target_resolution": {
      +        "title": "Target Resolution",
      +        "type": "string"
      +      },
      +      "type_descriptor": {
      +        "title": "Type Descriptor",
      +        "type": "string"
      +      },
      +      "value": {
      +        "title": "Value",
      +        "type": "string"
      +      }
      +    },
      +    "title": "DexRow",
      +    "type": "object"
      +  },
      +  "Source": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "container_entry": {
      +        "title": "Container Entry",
      +        "type": "string"
      +      },
      +      "declared_class_count": {
      +        "title": "Declared Class Count",
      +        "type": "integer"
      +      },
      +      "dex_entry": {
      +        "title": "Dex Entry",
      +        "type": "string"
      +      },
      +      "dex_version": {
      +        "title": "Dex Version",
      +        "type": "string"
      +      },
      +      "path": {
      +        "title": "Path",
      +        "type": "string"
      +      },
      +      "sha256": {
      +        "title": "Sha256",
      +        "type": "string"
      +      },
      +      "size_bytes": {
      +        "title": "Size Bytes",
      +        "type": "integer"
      +      }
      +    },
      +    "title": "Source",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties
      Added value: +{
      +  "apk_path": {
      +    "title": "Apk Path",
      +    "type": "string"
      +  },
      +  "apk_sha256": {
      +    "title": "Apk Sha256",
      +    "type": "string"
      +  },
      +  "artifact_path": {
      +    "title": "Artifact Path",
      +    "type": "string"
      +  },
      +  "artifact_sha256": {
      +    "title": "Artifact Sha256",
      +    "type": "string"
      +  },
      +  "backend": {
      +    "title": "Backend",
      +    "type": "string"
      +  },
      +  "backend_version": {
      +    "title": "Backend Version",
      +    "type": "string"
      +  },
      +  "class_name": {
      +    "title": "Class Name",
      +    "type": "string"
      +  },
      +  "code": {
      +    "title": "Code",
      +    "type": "string"
      +  },
      +  "coverage": {
      +    "title": "Coverage",
      +    "type": "string"
      +  },
      +  "has_more": {
      +    "title": "Has More",
      +    "type": "boolean"
      +  },
      +  "input_id": {
      +    "title": "Input Id",
      +    "type": "string"
      +  },
      +  "items": {
      +    "items": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "$ref": "#/$defs/DexRow"
      +        }
      +      ]
      +    },
      +    "title": "Items",
      +    "type": "array"
      +  },
      +  "kind": {
      +    "title": "Kind",
      +    "type": "string"
      +  },
      +  "limit": {
      +    "title": "Limit",
      +    "type": "integer"
      +  },
      +  "limitations": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "title": "Limitations",
      +    "type": "array"
      +  },
      +  "message": {
      +    "title": "Message",
      +    "type": "string"
      +  },
      +  "next_offset": {
      +    "anyOf": [
      +      {
      +        "type": "integer"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "title": "Next Offset"
      +  },
      +  "offset": {
      +    "title": "Offset",
      +    "type": "integer"
      +  },
      +  "session_id": {
      +    "title": "Session Id",
      +    "type": "string"
      +  },
      +  "source": {
      +    "title": "Source",
      +    "type": "string"
      +  },
      +  "sources": {
      +    "items": {
      +      "$ref": "#/$defs/Source"
      +    },
      +    "title": "Sources",
      +    "type": "array"
      +  },
      +  "status": {
      +    "enum": [
      +      "ok",
      +      "partial",
      +      "error",
      +      "not_applicable"
      +    ],
      +    "title": "Status",
      +    "type": "string"
      +  },
      +  "total": {
      +    "title": "Total",
      +    "type": "integer"
      +  },
      +  "truncated": {
      +    "title": "Truncated",
      +    "type": "boolean"
      +  },
      +  "xml": {
      +    "title": "Xml",
      +    "type": "string"
      +  }
      +}
    • changedOutput schema / title
      Previous value: -"asc_get_class_sourceDictOutput"New value: +"LegacyResult"
  4. First observedv0.1.1

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and closed-world scope, so the safety profile is covered. The description adds useful context that results are paginated and bounded, but says nothing about decompilation cost, failure modes for an unknown class, or backend trade-offs that the schema hints at.

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?

A single front-loaded sentence with zero filler; the core action and the paged return are both delivered up front.

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

Completeness4/5

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

With a full output schema, return-value documentation is unnecessary, and the description covers scope and pagination adequately. It could go further on error behavior for missing classes and on the backend choice, but nothing essential to a correct call is missing.

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 all six parameters are documented in the schema itself, establishing a baseline of 3. The phrase "bounded page of source lines" reinforces the limit/offset semantics but adds no syntax or constraint detail beyond what the schema already provides.

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+resource pair ("decompile one class") and the return shape ("bounded page of source lines"). The singular framing implicitly distinguishes it from asc_list_classes, but no sibling is named explicitly.

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?

Usage is only implied: an agent can infer this is the tool for pulling the source of a specific class rather than enumerating classes. There is no explicit when-to-use/when-not or pointer to alternatives like asc_find_refs or asc_list_classes, and no mention of what to do if the class is not found.

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