Skip to main content
Glama
cbxss
by cbxss

clear_hook_messages

Clear the hook message buffer without retrieving messages, preventing buffer overflow and enabling continuous Frida instrumentation during Android security testing.

Instructions

Clear the hook message buffer without retrieving

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for clear_hook_messages. Gets the active FridaSession and calls fs.clear_messages() to clear the hook message buffer, returning the count of cleared messages and session_id.
    def clear_hook_messages() -> dict:
        """Clear the hook message buffer."""
        fs = get_session()
        count = fs.clear_messages()
        return {"cleared": count, "session_id": fs.id}
  • Tool registration definition. Declares the 'clear_hook_messages' tool with an empty inputSchema (no arguments needed) and a description: 'Clear the hook message buffer without retrieving'.
    Tool(
        name="clear_hook_messages",
        description="Clear the hook message buffer without retrieving",
        inputSchema={"type": "object", "properties": {}, "required": []},
    ),
  • Dispatch routing in call_tool function. Maps the string 'clear_hook_messages' to hooks.clear_hook_messages() when the tool is called by name.
    elif name == "clear_hook_messages":
        return hooks.clear_hook_messages()
  • The FridaSession.clear_messages() method called by the handler. Thread-safe clearing of the hook_messages list, returns the count of messages cleared.
    def clear_messages(self) -> int:
        """Thread-safe message clearing."""
        with self._lock:
            count = len(self.hook_messages)
            self.hook_messages = []
            return count
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description only states the action without disclosing side effects, reversibility, or impact on other hooks. For a destructive operation, more detail is expected.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words, immediately conveys the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple parameterless tool with no output schema, the description adequately covers the purpose. Could mention if clearing affects continuous hooking or is reversible.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters (coverage 100%), so the description adds no parameter info. Baseline 3 applies per criteria.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'clear' and the resource 'hook message buffer', distinguishing it from the sibling tool 'get_hook_messages' which retrieves messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'without retrieving' implies this tool is used when you want to clear without reading, contrasting with 'get_hook_messages'. However, no explicit when-not or alternatives are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cbxss/frida-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server