Skip to main content
Glama
FangYuan33

easy-code-reader

by FangYuan33

read_jar_source

Read Java class source from Maven JARs, handling inner classes and SNAPSHOT versions. Provide Maven coordinates and optional line range to get full or partial code with artifact details.

Instructions

读取 Maven JAR 中指定 Java 类的源码。优先使用 sources JAR;SNAPSHOT 优先读取普通包,普通包不存在时回退时间戳包。内部类使用 Outer$Inner,必要时返回外部类源码并附简短提示。默认返回全文;start_line/end_line 为从 1 开始、包含首尾的可选行范围。全文结果包含 class_name、artifact、source_type、code;分段读取附带行数信息,失败设置 isError=true。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
versionYesMaven 版本;SNAPSHOT 优先读取普通包,使用最新时间戳文件名管理缓存
end_lineNo
group_idYesMaven groupId,如 org.springframework
class_nameYes完整 Java 类名;内部类使用 $
start_lineNo
artifact_idYesMaven artifactId,如 spring-core
prefer_sourcesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full disclosure burden, and it delivers: it states the sources-JAR preference, the SNAPSHOT normal→timestamp fallback, the inner-class behavior of returning the outer class with a brief hint, the full-text return fields (class_name, artifact, source_type, code), the line-count info for segmented reads, and that failures set isError=true. This is unusually transparent for a tool with zero annotation coverage.

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

Conciseness4/5

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

The description is one dense, information-packed paragraph with no filler. The core purpose is front-loaded in the first sentence, and every subsequent clause earns its place (SNAPSHOT fallback, inner-class naming, line ranges, return fields, error flag). It is slightly dense, but appropriately sized for the amount of behavior it must disclose.

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 tool with 7 parameters, no annotations, and no output schema, the description covers the essentials comprehensively: source preference, fallback logic, special class-name handling, range semantics, return structure, and error signaling. The only minor gap is the absence of an explicit pointer to the sibling search tool for discovery workflows, but nothing an agent needs to call it correctly is missing.

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 coverage is 57% (4 of 7 params described in schema; start_line, end_line, and prefer_sources are undocumented). The description compensates for exactly those gaps: it clarifies that start_line/end_line are 1-based and inclusive of both ends, and that prefer_sources governs the sources-JAR priority. It also adds meaning for class_name by specifying the $ inner-class syntax.

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 opens with a specific verb+resource pair ('读取 Maven JAR 中指定 Java 类的源码' – read the source of a named Java class in a Maven JAR), which states exactly what the tool does. It is clearly distinguishable from the sibling search_group_id, which is a discovery tool rather than a retrieval tool, and it names the precise inputs (group_id, artifact_id, version, class_name) the agent needs.

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?

The description gives rich how-to-use guidance: inner classes must use Outer$Inner, SNAPSHOT packages fall back from normal to timestamp, and start_line/end_line are 1-based inclusive ranges. However, there is no explicit when-to-use or when-not-to-use statement contrasting it with the sibling search_group_id – the differentiation is left implicit (read vs. search) rather than stated.

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

Deploy Server

Other Tools