Skip to main content
Glama

jules_get_cookies

Extract current browser cookies to maintain session persistence and create backups for Google Jules AI coding assistant workflows.

Instructions

Extract current browser cookies for session persistence and backup

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format for cookies (default: json)

Implementation Reference

  • The main handler function that extracts cookies from the browser context using Playwright's page.context().cookies() and returns them in JSON or string format.
    private async getCookies(args: any) {
      const { format = 'json' } = args;
      const page = await this.getPage();
    
      try {
        const cookies = await page.context().cookies();
        
        if (format === 'string') {
          const cookieString = cookies.map(cookie => 
            `${cookie.name}=${cookie.value}; domain=${cookie.domain}; path=${cookie.path}`
          ).join('; ');
          
          return {
            content: [
              {
                type: 'text',
                text: `Cookie String:\\n${cookieString}`
              }
            ]
          };
        } else {
          return {
            content: [
              {
                type: 'text',
                text: `Cookies (${cookies.length} total):\\n${JSON.stringify(cookies, null, 2)}`
              }
            ]
          };
        }
      } catch (error) {
        throw new Error(`Failed to get cookies: ${error}`);
      }
    }
  • The tool schema definition including name, description, and input schema registered in the ListToolsRequestSchema handler.
      name: 'jules_get_cookies',
      description: 'Extract current browser cookies for session persistence and backup',
      inputSchema: {
        type: 'object',
        properties: {
          format: {
            type: 'string',
            enum: ['json', 'string'],
            description: 'Output format for cookies (default: json)',
          },
        },
      },
    },
  • src/index.ts:384-384 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement, dispatching calls to the getCookies method.
    return await this.getCookies(args);
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. It mentions the tool's purpose but lacks behavioral details such as permissions needed, whether it accesses sensitive data, rate limits, or what the output looks like. 'Extract' suggests a read operation, but without annotations, safety and behavioral context are insufficiently disclosed.

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, efficient sentence that states the purpose clearly without redundancy. It is appropriately sized and front-loaded, with no wasted words.

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 no annotations and no output schema, the description is incomplete. It explains the tool's purpose but lacks details on behavior, output format, or error handling. For a tool that likely handles sensitive data (cookies), more context is needed to ensure safe and correct usage.

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%, with one parameter ('format') fully documented in the schema. The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage without compensating value.

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

Purpose4/5

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

The description clearly states the action ('Extract') and resource ('current browser cookies'), with a specific purpose ('for session persistence and backup'). It distinguishes from sibling 'jules_set_cookies' by being a read operation versus a write operation, though it doesn't explicitly name alternatives.

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 implies usage context ('session persistence and backup') but doesn't provide explicit guidance on when to use this tool versus alternatives like 'jules_session_info' or 'jules_set_cookies'. No exclusions or prerequisites are mentioned.

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/mberjans/google-jules-mcp'

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