Skip to main content
Glama
TiagoDanin

Android Debug Bridge MCP

by TiagoDanin

input_scroll

Simulate scrolling on Android devices for automation and testing. Specify direction (up, down, left, right) to navigate app interfaces.

Instructions

Perform scroll action

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionYesDirection to scroll

Implementation Reference

  • The handler function for the 'input_scroll' tool. It destructures the direction from args, maps it to an ADB swipe command, executes the command, captures the updated UI content, and returns a response with a confirmation message and the UI dump.
    input_scroll: async (args: any) => {
      const { direction } = args as { direction: string };
      
      const scrollCommands = {
        up: 'adb shell input swipe 500 800 500 400',
        down: 'adb shell input swipe 500 400 500 800',
        left: 'adb shell input swipe 800 500 400 500',
        right: 'adb shell input swipe 400 500 800 500',
      };
      
      const command = scrollCommands[direction as keyof typeof scrollCommands];
      if (!command) {
        throw new McpError(ErrorCode.InvalidParams, `Invalid direction: ${direction}`);
      }
      
      await executeCommand(command);
      
      const uiContent = await captureUIContent(false);
      
      return {
        content: [
          {
            type: 'text',
            text: `Scroll executed: ${direction}`,
          },
          ...uiContent,
        ],
      };
    },
  • The schema definition for the 'input_scroll' tool, including name, description, and inputSchema specifying the required 'direction' parameter with allowed values.
      name: 'input_scroll',
      description: 'Perform scroll action',
      inputSchema: {
        type: 'object',
        properties: {
          direction: {
            type: 'string',
            enum: ['up', 'down', 'left', 'right'],
            description: 'Direction to scroll',
          },
        },
        required: ['direction'],
      },
    },
  • src/index.ts:32-46 (registration)
    The MCP server request handler for CallToolRequestSchema that dynamically dispatches to the appropriate tool handler (including input_scroll) from the toolHandlers object based on the tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        const handler = toolHandlers[name as keyof typeof toolHandlers];
        if (!handler) {
          throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
        }
    
        return await handler(args);
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(ErrorCode.InternalError, `Tool execution failed: ${errorMessage}`);
      }
    });
  • src/index.ts:26-30 (registration)
    The MCP server request handler for ListToolsRequestSchema that returns the list of tool definitions, including the schema for input_scroll.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: toolDefinitions,
      };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Perform scroll action' implies a mutation (scrolling changes viewport position), but it doesn't specify if this requires permissions, has side effects (e.g., triggering UI updates), or details on execution (e.g., smooth vs. instant scroll). The description is too minimal to convey behavioral traits beyond the basic action.

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?

The description is extremely concise with a single sentence 'Perform scroll action', which is front-loaded and wastes no words. It efficiently states the core action without redundancy, making it easy to parse quickly. This minimalism is appropriate for a simple tool, though it may sacrifice clarity.

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

Completeness2/5

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

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It doesn't cover what the tool scrolls (e.g., a screen or element), behavioral aspects like side effects, or usage context relative to siblings. For a mutation tool with no annotations, more detail is needed to ensure the agent can use it correctly without guesswork.

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 100% description coverage, with the parameter 'direction' fully documented via enum values ('up', 'down', 'left', 'right'). The description adds no meaning beyond the schema, as it doesn't explain parameter usage (e.g., how direction relates to UI orientation) or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Perform scroll action' states a verb ('Perform') and resource/action ('scroll action'), making the purpose identifiable but vague. It doesn't specify what is being scrolled (e.g., a UI, webpage, or viewport) or distinguish it from sibling tools like 'input_tap' or 'input_keyevent', which are also input actions. The purpose is clear at a high level but lacks specificity for precise tool selection.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention context (e.g., scrolling in an app vs. a webpage), prerequisites, or exclusions. With siblings like 'input_tap' and 'input_keyevent' for other input types, the agent must infer usage based on the tool name alone, which is insufficient for informed decisions.

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/TiagoDanin/Android-Debug-Bridge-MCP'

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