Skip to main content
Glama

decompile_class

Decompile Java class source code from running JVM processes to analyze and understand application behavior during runtime debugging.

Instructions

反编译指定类的源码

        Args:
            pid (str): 进程ID,使用字符串形式(如:"12345")
            class_pattern (str): 类名表达式匹配
            method_pattern (Optional[str]): 可选的方法名表达式

        Returns:
            Dict: 包含反编译源码的字典(暂未实现)
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNo
class_patternNo
method_patternNo

Implementation Reference

  • Handler function for the 'decompile_class' tool, registered via @self.mcp.tool() decorator. Defines input parameters (pid, class_pattern, method_pattern) and returns a stub error response indicating it is not yet implemented.
    @self.mcp.tool()
    def decompile_class(pid: str = "", 
                       class_pattern: str = "", 
                       method_pattern: Optional[str] = None) -> Dict:
        """反编译指定类的源码
    
        Args:
            pid (str): 进程ID,使用字符串形式(如:"12345")
            class_pattern (str): 类名表达式匹配
            method_pattern (Optional[str]): 可选的方法名表达式
    
        Returns:
            Dict: 包含反编译源码的字典(暂未实现)
        """
        return {"success": False, "error": "未实现/不支持"}
  • Registration of the 'decompile_class' tool using the FastMCP decorator.
    @self.mcp.tool()
  • Input/output schema defined in the function docstring, describing parameters and return type.
    """反编译指定类的源码
    
    Args:
        pid (str): 进程ID,使用字符串形式(如:"12345")
        class_pattern (str): 类名表达式匹配
        method_pattern (Optional[str]): 可选的方法名表达式
    
    Returns:
        Dict: 包含反编译源码的字典(暂未实现)
    """
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool decompiles source code and mentions the return is '暂未实现' (not yet implemented), which is important behavioral information. However, it doesn't disclose critical aspects like: whether this requires special permissions, if it's a read-only operation, potential performance impact, or what happens when patterns don't match. The 'not yet implemented' warning is helpful but insufficient for full transparency.

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 appropriately sized and front-loaded with the core purpose first. The Args/Returns structure is clear, though the Chinese/English mix and formatting could be slightly cleaner. Every sentence earns its place by conveying essential information about purpose, parameters, and implementation status.

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 this is a 3-parameter tool with no annotations and no output schema, the description does an adequate but incomplete job. It covers the basic purpose and parameters well, but lacks important context about when to use it, behavioral constraints, and what the actual output will contain (beyond the 'not yet implemented' warning). For a decompilation tool that likely interacts with running processes, more operational context would be beneficial.

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?

With 0% schema description coverage, the description must compensate - and it does well by explaining all three parameters: pid as process ID in string format, class_pattern as class name expression matching, and method_pattern as optional method name expression. This adds significant meaning beyond the bare schema. The only minor gap is not explaining what 'expression matching' entails (regex, wildcards, etc.).

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's purpose as '反编译指定类的源码' (decompile source code of specified class), which is a specific verb+resource combination. It distinguishes itself from siblings like get_class_info or search_method by focusing on decompilation rather than information retrieval or searching. However, it doesn't explicitly contrast with all possible siblings.

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. It doesn't mention prerequisites (like needing a running Java process), when this tool is appropriate versus other debugging tools in the sibling list, or any limitations. The agent must infer usage context from parameter requirements alone.

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