Skip to main content
Glama
maderwin

pinchtab-mcp

Get Cookies

pinchtab_cookies

Retrieve all cookies set by the currently active webpage to inspect or debug session data.

Instructions

Get all cookies for the current page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of 'pinchtab_cookies' tool via server.registerTool. It calls pinch('GET', '/cookies') to retrieve all cookies for the current page.
    server.registerTool(
      "pinchtab_cookies",
      {
        description: "Get all cookies for the current page.",
        inputSchema: z.object({}),
        title: "Get Cookies",
      },
      async () => {
        try {
          return toolResult(await pinch("GET", "/cookies"));
        } catch (error) {
          return toolError(error);
        }
      },
    );
  • The pinch() helper function that makes HTTP requests to the PinchTab server. Used by the cookies tool to GET /cookies.
    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();
    }
  • The toolResult() and toolError() helper functions used by the cookies handler to format success/error responses.
    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,
      };
    }
  • Input schema for pinchtab_cookies: an empty object (z.object({})), meaning no parameters are required.
    description: "Get all cookies for the current page.",
    inputSchema: z.object({}),
    title: "Get Cookies",
  • registerAllTools() calls registerInstanceTools(), which registers pinchtab_cookies among other tools.
    export function registerAllTools(server: McpServer) {
      registerInstanceTools(server);
      registerNavigationTools(server);
      registerInteractionTools(server);
      registerContentTools(server);
    }
Behavior4/5

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

Without annotations, the description bears full responsibility for behavioral disclosure. It accurately indicates a read operation on cookies, implying no side effects. However, it omits details like whether HTTP-only cookies are included or potential error conditions.

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 concise sentence that immediately conveys the tool's purpose. Every word is necessary, and it is front-loaded with the action and resource.

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?

Given the tool's simplicity (no parameters, no output schema), the description is minimally adequate. However, it lacks context about the return format or any filtering (e.g., domain scope), which would help the agent use the output correctly.

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?

The tool has zero parameters and 100% schema coverage. According to guidelines, 0 parameters warrant a baseline score of 4. The description adds no parameter info, which is acceptable since none exist.

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 'Get' and the resource 'all cookies for the current page', distinguishing it from sibling tools like pinchtab_click or pinchtab_navigate which perform actions rather than data retrieval.

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?

No guidance is provided on when to use this tool versus alternatives. There is no mention of use cases, prerequisites, or exclusions, leaving the agent to infer usage solely from the name.

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