Skip to main content
Glama
pgatzka

jar-inspector-mcp

jar_read_source

Read-only

Inspect source code inside JAR archives without extraction. Reads Java/Kotlin source line-by-line from the JAR or adjacent sources jar, falling back to class outline when unavailable.

Instructions

Read attached Java/Kotlin source for a class, one line window at a time.

Looks inside the archive itself, then the matching -sources.jar next to it (Maven layout) or beside it in the Gradle cache. If no source is available, say so and fall back to jar_class_outline.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. target: FQCN (com.acme.Foo) or an entry path (com/acme/Foo.java). start_line: 1-based first line to show. line_count: How many lines to show; use a window rather than whole files. sources_jar: Explicit sources archive, when auto-detection misses it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jarYes
targetYes
line_countNo
start_lineNo
sources_jarNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses the search order: inside the archive itself, then the matching -sources.jar in Maven or Gradle layout. It also explains the behavior when source is unavailable ('say so and fall back to jar_class_outline') and details the explicit sources_jar override. This is rich behavioral context that the annotations alone do not provide.

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?

The opening sentence states the core purpose immediately. The behavior is explained in a short paragraph, followed by a compact Args list that documents every parameter. Each sentence earns its place, and the fallback and override details are included without unnecessary verbosity.

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?

For a tool with five parameters, no schema-level descriptions, and an output schema present, the description is complete. It covers all parameters, explains archive/source resolution, gives the fallback path, and sets expectations about windowed reading. There is no meaningful missing information an agent would need to select or invoke it correctly.

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 carry the full burden of parameter documentation. It does: jar accepts an archive path, classes directory, or nested jar syntax; target accepts an FQCN or entry path; start_line is 1-based; line_count is meant for windowed reading; sources_jar is an explicit override. This adds significant meaning beyond the bare schema properties.

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 states a specific verb and resource: 'Read attached Java/Kotlin source for a class, one line window at a time.' This clearly distinguishes it from sibling tools like jar_class_outline and jar_read_entry by focusing on source code and line-window access. The name and description align well, and the fallback mention reinforces its role.

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?

The description gives clear context for when to use the tool: reading attached source for a class, and explicitly says to fall back to jar_class_outline if no source is available. It also advises using a line window rather than reading entire files. It does not enumerate all sibling alternatives, but the fallback and windowing guidance provide practical routing.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pgatzka/jar-inspector-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server