Skip to main content
Glama
maderwin

pinchtab-mcp

Type

pinchtab_type

Type text into input fields by element reference ID. Uses human-like keystroke simulation; optionally clear field first for React/Vue/Angular inputs.

Instructions

Type text into an input field by its ref ID. Uses human-like typing by default. Set clearFirst=true to click, select all, then type — required for React/Vue/Angular inputs where direct fill doesn't trigger state updates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearFirstNoClick the field, select all (Ctrl+A), then type. Required for React/Vue/Angular inputs.
fastNoSpeed up humanType with shorter delays between keystrokes. Only applies when humanType=true.
humanTypeNoUse human-like keystroke simulation (default: true). Set to false for fast programmatic fill.
refYesElement reference ID of the input field
textYesText to type into the field

Implementation Reference

  • Registration of the 'pinchtab_type' tool on the MCP server, including its schema and handler.
    server.registerTool(
      "pinchtab_type",
      {
        description:
          "Type text into an input field by its ref ID. Uses human-like typing by default. Set clearFirst=true to click, select all, then type — required for React/Vue/Angular inputs where direct fill doesn't trigger state updates.",
        inputSchema: z.object({
          clearFirst: z
            .boolean()
            .optional()
            .describe(
              "Click the field, select all (Ctrl+A), then type. Required for React/Vue/Angular inputs.",
            ),
          fast: z
            .boolean()
            .optional()
            .describe(
              "Speed up humanType with shorter delays between keystrokes. Only applies when humanType=true.",
            ),
          humanType: z
            .boolean()
            .optional()
            .describe(
              "Use human-like keystroke simulation (default: true). Set to false for fast programmatic fill.",
            ),
          ref: z.string().describe("Element reference ID of the input field"),
          text: z.string().describe("Text to type into the field"),
        }),
        title: "Type",
      },
      async ({ ref, text, humanType, fast, clearFirst }) => {
        try {
          if (clearFirst) {
            await pinch("POST", "/action", { kind: "click", ref });
            await pinch("POST", "/action", { key: "Control+a", kind: "press", ref });
            await pinch("POST", "/action", { kind: "type", ref, text });
            return toolResult({ cleared: true, ref, typed: text });
          }
          const kind = humanType === false ? "fill" : "humanType";
          const body: Record<string, unknown> = { kind, ref, text };
          if (fast && kind === "humanType") body.fast = true;
          return toolResult(await pinch("POST", "/action", body));
        } catch (error) {
          return toolError(error);
        }
      },
    );
  • Input schema (Zod) for the pinchtab_type tool, defining ref, text, humanType, fast, and clearFirst parameters.
    inputSchema: z.object({
      clearFirst: z
        .boolean()
        .optional()
        .describe(
          "Click the field, select all (Ctrl+A), then type. Required for React/Vue/Angular inputs.",
        ),
      fast: z
        .boolean()
        .optional()
        .describe(
          "Speed up humanType with shorter delays between keystrokes. Only applies when humanType=true.",
        ),
      humanType: z
        .boolean()
        .optional()
        .describe(
          "Use human-like keystroke simulation (default: true). Set to false for fast programmatic fill.",
        ),
      ref: z.string().describe("Element reference ID of the input field"),
      text: z.string().describe("Text to type into the field"),
    }),
  • Handler function for pinchtab_type: dispatches /action HTTP calls to the PinchTab backend with kind 'humanType' (default), 'fill', or a clearFirst sequence (click, Ctrl+A, type).
    async ({ ref, text, humanType, fast, clearFirst }) => {
      try {
        if (clearFirst) {
          await pinch("POST", "/action", { kind: "click", ref });
          await pinch("POST", "/action", { key: "Control+a", kind: "press", ref });
          await pinch("POST", "/action", { kind: "type", ref, text });
          return toolResult({ cleared: true, ref, typed: text });
        }
        const kind = humanType === false ? "fill" : "humanType";
        const body: Record<string, unknown> = { kind, ref, text };
        if (fast && kind === "humanType") body.fast = true;
        return toolResult(await pinch("POST", "/action", body));
      } catch (error) {
        return toolError(error);
      }
    },
  • The 'pinch' helper function used by the handler to make HTTP requests to the PinchTab backend (POST /action).
    export async function pinch(
      method: string,
      path: string,
      body?: Record<string, unknown>,
    ): Promise<unknown> {
      if (!(await isPinchtabRunning())) {
  • Helper functions toolResult and toolError used by the handler to format MCP responses.
    interface ToolResult {
      [key: string]: unknown;
      content: { text: string; type: "text" }[];
      isError?: boolean;
    }
    
    /** Wrap a tool handler with standardized error handling. */
    export function toolResult(data: unknown): ToolResult {
Behavior4/5

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

With no annotations, the description fairly discloses key behaviors: human-like typing by default, clearFirst clicks and selects all, and fast speeds keystrokes. It does not mention side effects like clearing existing text or visibility requirements, but covers essential traits.

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 three sentences, front-loaded with the core purpose. Every sentence adds value: purpose, default behavior, and parameter guidance. No waste.

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?

Given 5 parameters, no output schema, and no annotations, the description covers the main behavioral traits and parameter nuances. It omits return value and error conditions, but overall is sufficient for a typing tool.

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?

Schema coverage is 100%, but the description adds meaningful context beyond the schema: it explains the default for humanType, the necessity of clearFirst for React/Vue/Angular, and the effect of fast. However, it does not add detail for ref or text parameters.

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 'Type text into an input field by its ref ID', specifying the verb, resource, and distinguishing from sibling tools like pinchtab_click or pinchtab_press. It adds context about human-like typing and the clearFirst option for frameworks.

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 description provides clear context for when to use clearFirst, fast, and humanType parameters. However, it does not explicitly guide when to use this tool versus siblings like pinchtab_press or pinchtab_get_text, missing some alternative differentiation.

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