get_stack_trace_by_method
Retrieve Java method call stacks by specifying process ID, class and method patterns, with optional filtering conditions for debugging and performance analysis in JVM applications.
Instructions
获取方法的调用路径
Args:
pid (str): 进程ID,使用字符串形式(如:"12345")
class_pattern (str): 类名表达式匹配
method_pattern (str): 方法名表达式匹配
condition (Optional[str]): 条件表达式,例如:'params[0]<0' 或 '#cost>10'
use_regex (bool): 是否开启正则表达式匹配,默认为通配符匹配
max_matches (str): Class最大匹配数量,使用字符串形式(如:"50")
max_times (str): 执行次数限制,使用字符串形式
Returns:
Dict: 包含方法调用路径信息的字典(暂未实现)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | ||
| class_pattern | No | ||
| method_pattern | No | ||
| condition | No | ||
| use_regex | No | ||
| max_matches | No | ||
| max_times | No |
Implementation Reference
- src/jvm_mcp_server/server.py:467-488 (handler)Handler function decorated with @self.mcp.tool(), which registers the tool. This is the exact implementation (currently a stub indicating '未实现/不支持' - not implemented). Defines input parameters with type hints and docstring describing schema. Executes by returning an error.@self.mcp.tool() def get_stack_trace_by_method(pid: str = "", class_pattern: str = "", method_pattern: str = "", condition: Optional[str] = None, use_regex: bool = False, max_matches: str = "", max_times: str = "") -> Dict: """获取方法的调用路径 Args: pid (str): 进程ID,使用字符串形式(如:"12345") class_pattern (str): 类名表达式匹配 method_pattern (str): 方法名表达式匹配 condition (Optional[str]): 条件表达式,例如:'params[0]<0' 或 '#cost>10' use_regex (bool): 是否开启正则表达式匹配,默认为通配符匹配 max_matches (str): Class最大匹配数量,使用字符串形式(如:"50") max_times (str): 执行次数限制,使用字符串形式 Returns: Dict: 包含方法调用路径信息的字典(暂未实现) """ return {"success": False, "error": "未实现/不支持"}
- src/jvm_mcp_server/server.py:467-467 (registration)The @self.mcp.tool() decorator registers the 'get_stack_trace_by_method' tool with the FastMCP server.@self.mcp.tool()