Skip to main content
Glama

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
NameRequiredDescriptionDefault
class_patternYes
conditionNo
max_timesNo
method_patternYes
pidYes
watch_paramsNo
watch_returnNo

Implementation Reference

  • 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": "未实现/不支持"}
  • Registration of the 'watch_method' tool using the FastMCP decorator.
    @self.mcp.tool()

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