Skip to main content
Glama
maderwin

pinchtab-mcp

Select

pinchtab_select

Select an option in a dropdown by referencing the element ID and providing the option value or visible text.

Instructions

Select an option in a dropdown by its ref ID. Pass the option value or visible text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesElement reference ID of the <select>
valueYesOption value or visible text to select

Implementation Reference

  • Registration of the 'pinchtab_select' tool via server.registerTool().
    server.registerTool(
      "pinchtab_select",
      {
        description:
          "Select an option in a <select> dropdown by its ref ID. Pass the option value or visible text.",
        inputSchema: z.object({
          ref: z.string().describe("Element reference ID of the <select>"),
          value: z.string().describe("Option value or visible text to select"),
        }),
        title: "Select",
      },
      async ({ ref, value }) => {
        try {
          return toolResult(
            await pinch("POST", "/action", {
              kind: "select",
              ref,
              value,
            }),
          );
        } catch (error) {
          return toolError(error);
        }
      },
    );
  • Input schema for pinchtab_select: requires 'ref' (string) and 'value' (string) fields.
    inputSchema: z.object({
      ref: z.string().describe("Element reference ID of the <select>"),
      value: z.string().describe("Option value or visible text to select"),
    }),
  • Handler function that calls pinch('POST', '/action', { kind: 'select', ref, value }) and returns the result.
      async ({ ref, value }) => {
        try {
          return toolResult(
            await pinch("POST", "/action", {
              kind: "select",
              ref,
              value,
            }),
          );
        } catch (error) {
          return toolError(error);
        }
      },
    );
  • The 'pinch' helper function used by the handler to make HTTP requests to the PinchTab backend.
    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();
    }
  • Utility functions toolResult and toolError used to format the handler's response.
    /** Wrap a tool handler with standardized error handling. */
    export function toolResult(data: unknown): ToolResult {
      return { content: [{ text: toJson(data), type: "text" as const }] };
    }
    
    /** Format an error as an MCP tool error response. */
    export function toolError(error: unknown): ToolResult {
      const message = error instanceof Error ? error.message : String(error);
      return {
        content: [{ text: message, type: "text" as const }],
        isError: true,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It does not disclose behavioral traits like event firing, page interactions, or side effects beyond the basic action, leaving the agent uninformed about potential consequences.

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 consists of two concise sentences with no unnecessary words. It is front-loaded with the action and immediately provides key details.

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

Completeness5/5

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

Given the simplicity of the tool (2 simple parameters, no output schema), the description fully informs the agent about what to provide and how to use it. No missing information for correct invocation.

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?

Schema description coverage is 100% and the description essentially repeats the schema text for both parameters ('Option value or visible text' for value, 'by its ref ID' for ref). No additional meaning is added.

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 verb 'Select', the resource '<select> dropdown', and the method using 'ref ID' and 'option value or visible text'. This distinguishes it from sibling tools like pinchtab_click or pinchtab_get_text.

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

Usage Guidelines3/5

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

The description explains how to use the tool (by ref ID and value/text) but does not provide explicit guidance on when to use it vs. alternatives, such as pinchtab_click or pinchtab_type, or mention preconditions or exclusions.

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