Skip to main content
Glama

get_jvm_status

Retrieve detailed JVM status reports for specified Java processes. Use this tool to monitor and analyze JVM performance, thread activity, and memory usage, aiding in effective diagnostics and process optimization.

Instructions

获取JVM整体状态报告

Args: pid: 可选的进程ID,如果不指定则自动选择第一个非arthas的Java进程 Returns: 包含JVM状态信息的字典

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • Handler function decorated with @self.mcp.tool(), which registers the 'get_jvm_status' tool. Currently a stub implementation returning an error.
    @self.mcp.tool() def get_jvm_status(pid: str = "") -> Dict: """获取JVM整体状态报告 Args: pid (str): 进程ID,使用字符串形式(如:"12345")。 如果不指定则自动选择第一个Java进程 Returns: Dict: 包含JVM状态信息的字典(暂未实现) """ return {"success": False, "error": "未实现/不支持"}
  • Alternative handler in demo file that aggregates other tool outputs for JVM status.
    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() }
  • The @self.mcp.tool() decorator registers this function as an MCP tool.
    @self.mcp.tool() def get_jvm_status(pid: str = "") -> Dict: """获取JVM整体状态报告 Args: pid (str): 进程ID,使用字符串形式(如:"12345")。 如果不指定则自动选择第一个Java进程 Returns: Dict: 包含JVM状态信息的字典(暂未实现) """ return {"success": False, "error": "未实现/不支持"}

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