Skip to main content
Glama

clear_logs

Clear the Android device logcat buffer to obtain clean logs for debugging. Use before reproducing bugs to isolate relevant log entries.

Instructions

Clear the logcat buffer. Call this before reproducing a bug to get clean logs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idNoDevice ID (optional if only one device)

Implementation Reference

  • The implementation of the clear_logs logic via adb command.
    async clearLogcat(deviceId?: string): Promise<void> {
      await this.exec(["logcat", "-c"], deviceId);
    }
  • src/index.ts:542-550 (registration)
    The MCP tool registration and handler for clear_logs.
    server.tool(
      "clear_logs",
      "Clear the logcat buffer. Call this before reproducing a bug to get clean logs.",
      { device_id: z.string().optional().describe("Device ID (optional if only one device)") },
      async ({ device_id }) => {
        await adb.clearLogcat(device_id);
        return { content: [{ type: "text", text: "Logcat buffer cleared" }] };
      },
    );

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/martingeidobler/android-mcp-server'

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