watch_method
Monitor Java method calls in real-time by specifying class and method patterns, track parameters and return values, and set custom conditions for detailed JVM process analysis.
Instructions
监控方法的调用情况
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| class_pattern | Yes | ||
| condition | No | ||
| max_times | No | ||
| method_pattern | Yes | ||
| pid | Yes | ||
| watch_params | No | ||
| watch_return | No |
Implementation Reference
- src/jvm_mcp_server/server.py:530-550 (handler)The handler function for the 'watch_method' MCP tool. Registered via @self.mcp.tool() decorator. Defines input parameters and docstring schema. Currently returns a stub 'not implemented' response.@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": "未实现/不支持"}
- src/jvm_mcp_server/server.py:530-530 (registration)Registration of the 'watch_method' tool using the FastMCP decorator.@self.mcp.tool()