watch_method
Monitor Java method calls in real-time by tracking execution parameters, return values, and invocation frequency for debugging and performance analysis.
Instructions
监控方法的调用情况
Args:
pid (str): 进程ID,使用字符串形式(如:"12345")
class_pattern (str): 类名表达式匹配
method_pattern (str): 方法名表达式匹配
watch_params (bool): 是否监控方法参数
watch_return (bool): 是否监控方法返回值
condition (Optional[str]): 条件表达式
max_times (str): 最大监控次数,使用字符串形式(如:"10")
Returns:
Dict: 包含方法监控信息的字典(暂未实现)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | ||
| class_pattern | No | ||
| method_pattern | No | ||
| watch_params | No | ||
| watch_return | No | ||
| condition | No | ||
| max_times | No | 10 |
Implementation Reference
- src/jvm_mcp_server/server.py:530-550 (handler)The watch_method tool is registered via @self.mcp.tool() decorator and implemented as a handler function. The function signature and docstring define the input schema. Currently a stub implementation returning 'not implemented' error.@self.mcp.tool() def watch_method(pid: str = "", class_pattern: str = "", method_pattern: str = "", watch_params: bool = True, watch_return: bool = True, condition: Optional[str] = None, max_times: str = "10") -> Dict: """监控方法的调用情况 Args: pid (str): 进程ID,使用字符串形式(如:"12345") class_pattern (str): 类名表达式匹配 method_pattern (str): 方法名表达式匹配 watch_params (bool): 是否监控方法参数 watch_return (bool): 是否监控方法返回值 condition (Optional[str]): 条件表达式 max_times (str): 最大监控次数,使用字符串形式(如:"10") Returns: Dict: 包含方法监控信息的字典(暂未实现) """ return {"success": False, "error": "未实现/不支持"}