Skip to main content
Glama
maderwin

pinchtab-mcp

Scroll

pinchtab_scroll

Scroll web pages or specific elements in any direction. Specify pixel amount and direction for precise control.

Instructions

Scroll the page or a specific element. Supports all four directions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoScroll amount in pixels. Default: 500
directionYesScroll direction
refNoElement ref to scroll within (e.g. 'e5'). If omitted, scrolls the page.

Implementation Reference

  • Handler function for pinchtab_scroll. Constructs a scroll action body with optional amount (default 500px), direction, and optional element ref, then sends a POST /action request via the pinch client.
    async ({ direction, amount, ref }) => {
      try {
        const body: Record<string, unknown> = {
          amount: amount ?? DEFAULT_SCROLL_PX,
          direction,
          kind: "scroll",
        };
        if (ref) body.ref = ref;
        return toolResult(await pinch("POST", "/action", body));
      } catch (error) {
        return toolError(error);
      }
    },
  • Input schema for pinchtab_scroll: amount (optional number, default 500), direction (enum up/down/left/right), ref (optional string for element-scoped scrolling).
    {
      description: "Scroll the page or a specific element. Supports all four directions.",
      inputSchema: z.object({
        amount: z
          .number()
          .optional()
          .describe(`Scroll amount in pixels. Default: ${DEFAULT_SCROLL_PX}`),
        direction: z.enum(["up", "down", "left", "right"]).describe("Scroll direction"),
        ref: z
          .string()
          .optional()
          .describe("Element ref to scroll within (e.g. 'e5'). If omitted, scrolls the page."),
      }),
  • Registration of the 'pinchtab_scroll' tool via server.registerTool with description, inputSchema, title, and handler.
    server.registerTool(
      "pinchtab_scroll",
      {
        description: "Scroll the page or a specific element. Supports all four directions.",
        inputSchema: z.object({
          amount: z
            .number()
            .optional()
            .describe(`Scroll amount in pixels. Default: ${DEFAULT_SCROLL_PX}`),
          direction: z.enum(["up", "down", "left", "right"]).describe("Scroll direction"),
          ref: z
            .string()
            .optional()
            .describe("Element ref to scroll within (e.g. 'e5'). If omitted, scrolls the page."),
        }),
        title: "Scroll",
      },
      async ({ direction, amount, ref }) => {
        try {
          const body: Record<string, unknown> = {
            amount: amount ?? DEFAULT_SCROLL_PX,
            direction,
            kind: "scroll",
          };
          if (ref) body.ref = ref;
          return toolResult(await pinch("POST", "/action", body));
        } catch (error) {
          return toolError(error);
        }
      },
    );
  • The pinch() helper function that makes HTTP requests to the PinchTab API, used by the scroll handler to POST /action.
    export async function pinch(
      method: string,
      path: string,
      body?: Record<string, unknown>,
    ): Promise<unknown> {
      if (!(await isPinchtabRunning())) {
        await ensurePinchtabRunning();
      }
    
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
      };
      if (PINCHTAB_TOKEN) {
        headers["Authorization"] = `Bearer ${PINCHTAB_TOKEN}`;
      }
    
      const url = `${PINCHTAB_URL}${path}`;
    
      let res: Response;
      try {
        res = await fetch(url, {
          body: body ? JSON.stringify(body) : undefined,
          headers,
          method,
          signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
        });
      } catch (error) {
        if (error instanceof DOMException && error.name === "TimeoutError") {
          throw new Error(`PinchTab ${method} ${path} timed out after ${REQUEST_TIMEOUT_MS / 1000}s`);
        }
        throw error;
      }
    
      if (!res.ok) {
        const text = await res.text();
        throw new Error(`PinchTab ${method} ${path} → ${res.status}: ${text}`);
      }
    
      const contentType = (res.headers.get("content-type") ?? "").split(";")[0].toLowerCase().trim();
      if (contentType === "application/json") {
        return res.json();
      }
      return res.text();
    }
Behavior3/5

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

No annotations provided, so description must cover behavior. It states the action but omits details like scrolling behavior (smooth/jump), default effects, or prerequisites for the ref parameter.

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 a single, well-structured sentence that immediately conveys the core functionality without extraneous words.

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

Completeness3/5

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

For a simple scroll tool with no output schema and low complexity, the description is adequate but could mention return behavior and error conditions to be fully complete.

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

Parameters4/5

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

With 100% schema coverage, baseline is 3. The description adds value by clarifying that omitting ref scrolls the page, and including ref scopes within an element, going beyond enum and type descriptions.

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 tool scrolls a page or specified element in four directions, distinguishing it from other interaction tools like click or type.

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?

It effectively communicates the primary use case (scrolling) and covers all directions, but lacks explicit guidance on when not to use or comparisons with alternative tools.

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/maderwin/pinchtab-mcp'

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