Skip to main content
Glama

get_jvm_status

Retrieve comprehensive JVM status reports for Java processes, including thread analysis, memory monitoring, and performance diagnostics. Specify a process ID or use the first Java process found.

Instructions

获取JVM整体状态报告

        Args:
            pid (str): 进程ID,使用字符串形式(如:"12345")。
                如果不指定则自动选择第一个Java进程
        
        Returns:
            Dict: 包含JVM状态信息的字典(暂未实现)
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNo

Implementation Reference

  • Handler function for the 'get_jvm_status' MCP tool. Currently a stub that returns an error indicating it is not yet implemented.
    @self.mcp.tool()
    def get_jvm_status(pid: str = "") -> Dict:
        """获取JVM整体状态报告
        
        Args:
            pid (str): 进程ID,使用字符串形式(如:"12345")。
                如果不指定则自动选择第一个Java进程
        
        Returns:
            Dict: 包含JVM状态信息的字典(暂未实现)
        """
        return {"success": False, "error": "未实现/不支持"}
  • Full implementation of 'get_jvm_status' tool in the demo server using Arthas client. Aggregates thread, JVM, and memory info from other tools.
    @mcp.tool()
    def get_jvm_status(pid: Optional[int] = None) -> Dict:
        """获取JVM整体状态报告
        
        Args:
            pid: 可选的进程ID,如果不指定则自动选择第一个非arthas的Java进程
        
        Returns:
            包含JVM状态信息的字典
        """
        if pid is None:
            # 如果没有指定PID,获取第一个非arthas的Java进程
            processes = list_java_processes()
            for process in processes:
                if "arthas" not in process["name"].lower():
                    pid = int(process["pid"])
                    break
            if pid is None:
                return {"error": "No valid Java process found"}
    
        thread_info = get_thread_info(pid)
        jvm_info = get_jvm_info(pid)
        memory_info = get_memory_info(pid)
        
        return {
            "pid": pid,
            "thread_info": thread_info,
            "jvm_info": jvm_info,
            "memory_info": memory_info,
            "timestamp": time.time()
        }
  • Usage of get_jvm_status in the jvm_analysis_prompt function within the demo.
    status = get_jvm_status()
    status_json = json.dumps(status, indent=2)
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 automatic process selection behavior when PID isn't specified, which is useful. However, it doesn't describe what 'JVM整体状态报告' actually contains, whether it requires specific permissions, potential rate limits, error conditions, or that the return functionality is '暂未实现' (not yet implemented) - which is a significant behavioral limitation that should be more prominently disclosed.

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 reasonably structured with separate sections for Args and Returns, but contains some inefficiencies. The Chinese and English mixing creates minor readability issues, and the '暂未实现' (not yet implemented) note should be more prominent. The core purpose is stated upfront, but the structure could be more streamlined for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and 1 parameter, the description is incomplete. While it documents the parameter adequately, it fails to describe what the JVM status report contains, doesn't explain the '暂未实现' limitation clearly, and provides minimal behavioral context. The agent would struggle to understand what information this tool actually provides versus sibling tools.

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 fully compensates by providing complete parameter documentation. It explains the 'pid' parameter as a process ID in string format, provides an example ('12345'), and describes the default behavior when not specified. This adds substantial value beyond the bare schema, though it doesn't explain format constraints or validation rules.

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: '获取JVM整体状态报告' (Get JVM overall status report). It specifies the verb ('获取' - get) and resource ('JVM整体状态报告' - JVM overall status report), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_jvm_info' or 'get_memory_info', which likely provide more specific JVM information.

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 provides some usage context by mentioning that if no PID is specified, it automatically selects the first Java process. This gives basic guidance on when to provide the parameter. However, it doesn't explain when to use this tool versus alternatives like 'get_jvm_info' or 'list_java_processes', nor does it mention any prerequisites or exclusions for usage.

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