Skip to main content
Glama
zlx-cyber

JADX-MCP-SERVER

by zlx-cyber

get_class_source

Fetch the Java source of a specific class from decompiled Android apps, optionally with line numbers for placing comments; Kotlin metadata is stripped by default.

Instructions

Fetch the Java source of a specific class.

Set with_line_numbers=True to get every line prefixed with its 1-based line number. Those are the numbers add_comment takes as its 'line' argument, so use this before placing a line comment instead of counting lines yourself.

Kotlin compiler metadata (@Metadata / @DebugMetadata) is stripped by default, which is where a large part of a Kotlin dump goes; the line numbers stay the same, so add_comment keeps working. Pass slim=False for a raw, unmodified dump.

Input Schema

NameRequiredDescriptionDefault
slimNo
class_nameYes
with_line_numbersNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose non-obvious behavior: Kotlin @Metadata/@DebugMetadata is stripped by default, line numbers are preserved through that stripping, and with_line_numbers prefixes each line with 1-based numbers. It omits failure modes (nonexistent class, permissions) and payload size, keeping it below a 5.

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?

Purpose is front-loaded in one sentence, then two compact paragraphs each dedicated to a flag with its consequence. No filler; every sentence conveys a behavioral fact or an actionable instruction.

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?

For a 3-parameter read tool with no annotations, the description covers flag semantics, default transformations, and the downstream add_comment contract, while the output schema handles return shape. The missing piece is class-name input format/validation expectations.

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

Parameters4/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 compensate. It fully explains the two non-obvious flags (with_line_numbers semantics and slim default/stripping trade-off), but class_name is never described — no indication of qualified-name format or whether it must exist.

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?

States a specific verb and resource ('Fetch the Java source of a specific class'), which readily separates it from siblings that return smali (get_smali_of_class) or method/field listings. An agent knows exactly what artifact comes back.

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

Usage Guidelines4/5

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

Gives explicit workflow guidance: call this with with_line_numbers=True before add_comment 'instead of counting lines yourself', and pass slim=False when a raw dump is needed. It stops short of saying when to prefer this over get_smali_of_class or the bulk class-code tools, so not quite a full when/when-not map.

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