Skip to main content
Glama

get_class_info

Retrieve Java class information from running JVM processes using jmap and javap commands to analyze class structures, memory usage, and implementation details for debugging and monitoring.

Instructions

获取类信息 - 使用jmap -histo和javap命令获取完整的类信息

        Args:
            pid (str): 进程ID,使用字符串形式(如:"12345")
            class_pattern (str): 类名表达式匹配
            show_detail (bool): 是否显示详细信息,默认false
            show_field (bool): 是否显示成员变量信息(需要show_detail=True),默认false
            use_regex (bool): 是否使用正则表达式匹配,默认false
            depth (str): 属性遍历深度(暂未使用)
            classloader_hash (Optional[str]): 指定class的ClassLoader的hashcode(暂未使用)
            classloader_class (Optional[str]): 指定执行表达式的ClassLoader的class name(暂未使用)
            max_matches (str): 匹配类的最大数量,使用字符串形式(如:"50")

        Returns:
            Dict: 包含类信息的字典
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNo
class_patternNo
show_detailNo
show_fieldNo
use_regexNo
depthNo
classloader_hashNo
classloader_classNo
max_matchesNo
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool uses jmap and javap commands but doesn't describe what happens during execution (e.g., whether it pauses the JVM, requires specific permissions, has performance implications, or returns structured vs unstructured data). The description states it returns a 'Dict' but provides no details about the structure or content of that dictionary. For a tool with 9 parameters and no annotation coverage, this is insufficient.

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 description is appropriately front-loaded with the core purpose, but the parameter documentation section is quite lengthy (9 parameters with detailed explanations). While all parameter information is valuable given the 0% schema coverage, the structure could be more efficient. The description earns its length but isn't optimally concise.

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?

Given the complexity (9 parameters, no annotations, no output schema), the description does a good job explaining parameters but falls short on other aspects. It doesn't explain the tool's behavior during execution, doesn't describe the return value structure despite mentioning a 'Dict', and provides no usage context. The parameter documentation is comprehensive, but other critical context is missing for a tool of this complexity.

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?

The description provides excellent parameter documentation with clear explanations for each of the 9 parameters, including default values, dependencies (show_field requires show_detail=True), and implementation notes about parameters that are '暂未使用' (not yet used). With 0% schema description coverage, the description fully compensates by explaining what each parameter means, how they interact, and their expected formats. The only minor gap is not explaining the format of the returned dictionary.

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 description clearly states the tool '获取类信息' (get class information) and specifies it uses 'jmap -histo and javap commands' to obtain complete class information. This provides a specific verb ('获取' - get) and resource ('类信息' - class information) with implementation details. However, it doesn't explicitly differentiate from sibling tools like 'decompile_class' or 'search_method', which reduces it from a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. While it mentions using jmap and javap commands, it doesn't explain when this tool is preferred over sibling tools like 'decompile_class', 'search_method', or 'get_jvm_info'. There's no mention of prerequisites, typical use cases, or limitations that would help an agent choose appropriately.

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

Install Server

Other Tools

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/xzq-xu/jvm-mcp-server'

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