Skip to main content
Glama

jules_create_task

Create tasks for Google Jules AI coding assistant to automate development workflows in GitHub repositories with specific branch targeting.

Instructions

Create a new task in Google Jules with repository and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoGit branch to work on (optional, defaults to main)
descriptionYesTask description - what you want Jules to do
repositoryYesGitHub repository in format owner/repo-name

Implementation Reference

  • Main handler function that implements the jules_create_task tool. Uses Playwright to automate browser interactions for creating a task on the Jules website, fills in repo/branch/description, submits, extracts task ID/URL, and persists task data.
    private async createTask(args: any) {
      const { description, repository, branch = 'main' } = args;
      const page = await this.getPage();
    
      try {
        // Navigate to Jules task creation
        await page.goto(`${this.config.baseUrl}/task`);
        await page.waitForLoadState('networkidle');
    
        // Click new task button if needed
        const newTaskButton = page.locator('button.mat-mdc-tooltip-trigger svg');
        if (await newTaskButton.isVisible()) {
          await newTaskButton.click();
        }
    
        // Repository selection
        await page.locator("div.repo-select div.header-container").click();
        await page.locator("div.repo-select input").fill(repository);
        await page.locator("div.repo-select div.opt-list > swebot-option").first().click();
    
        // Branch selection
        await page.locator("div.branch-select div.header-container > div").click();
        
        // Try to find specific branch or select first available
        const branchOptions = page.locator("div.branch-select swebot-option");
        const branchCount = await branchOptions.count();
        if (branchCount > 0) {
          await branchOptions.first().click();
        }
    
        // Task description
        await page.locator("textarea").fill(description);
        await page.keyboard.press('Enter');
    
        // Submit
        await page.locator("div.chat-container button:nth-of-type(2)").click();
    
        // Wait for task creation and get URL
        await page.waitForURL('**/task/**');
        const url = page.url();
        const taskId = this.extractTaskId(url);
    
        // Create task object
        const task: JulesTask = {
          id: taskId,
          title: description.slice(0, 50) + (description.length > 50 ? '...' : ''),
          description,
          repository,
          branch,
          status: 'pending',
          createdAt: new Date().toISOString(),
          updatedAt: new Date().toISOString(),
          url,
          chatHistory: [],
          sourceFiles: []
        };
    
        // Save to data
        const data = await this.loadTaskData();
        data.tasks.push(task);
        await this.saveTaskData(data);
    
        return {
          content: [
            {
              type: 'text',
              text: `Task created successfully!\n\nTask ID: ${taskId}\nRepository: ${repository}\nBranch: ${branch}\nDescription: ${description}\nURL: ${url}\n\nTask is now pending Jules' analysis. You can check progress with jules_get_task.`
            }
          ]
        };
      } catch (error) {
        throw new Error(`Failed to create task: ${error}`);
      }
    }
  • Input schema definition for the jules_create_task tool, specifying required description and repository parameters.
      name: 'jules_create_task',
      description: 'Create a new task in Google Jules with repository and description',
      inputSchema: {
        type: 'object',
        properties: {
          description: {
            type: 'string',
            description: 'Task description - what you want Jules to do',
          },
          repository: {
            type: 'string',
            description: 'GitHub repository in format owner/repo-name',
          },
          branch: {
            type: 'string',
            description: 'Git branch to work on (optional, defaults to main)',
          },
        },
        required: ['description', 'repository'],
      },
    },
  • src/index.ts:360-398 (registration)
    Registration of tool handlers via setRequestHandler for CallToolRequestSchema, with switch case dispatching to createTask for 'jules_create_task'.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        switch (name) {
          case 'jules_create_task':
            return await this.createTask(args);
          case 'jules_get_task':
            return await this.getTask(args);
          case 'jules_send_message':
            return await this.sendMessage(args);
          case 'jules_approve_plan':
            return await this.approvePlan(args);
          case 'jules_resume_task':
            return await this.resumeTask(args);
          case 'jules_list_tasks':
            return await this.listTasks(args);
          case 'jules_analyze_code':
            return await this.analyzeCode(args);
          case 'jules_bulk_create_tasks':
            return await this.bulkCreateTasks(args);
          case 'jules_screenshot':
            return await this.takeScreenshot(args);
          case 'jules_get_cookies':
            return await this.getCookies(args);
          case 'jules_set_cookies':
            return await this.setCookies(args);
          case 'jules_session_info':
            return await this.getSessionInfo(args);
          case 'jules_setup_wizard':
            return await this.setupWizard(args);
          default:
            throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
        }
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(ErrorCode.InternalError, `Error in ${name}: ${errorMessage}`);
      }
    });
  • src/index.ts:118-358 (registration)
    Tool listing registration via setRequestHandler for ListToolsRequestSchema, which includes the jules_create_task tool in the returned tools array.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          // === CORE TASK MANAGEMENT ===
          {
            name: 'jules_create_task',
            description: 'Create a new task in Google Jules with repository and description',
            inputSchema: {
              type: 'object',
              properties: {
                description: {
                  type: 'string',
                  description: 'Task description - what you want Jules to do',
                },
                repository: {
                  type: 'string',
                  description: 'GitHub repository in format owner/repo-name',
                },
                branch: {
                  type: 'string',
                  description: 'Git branch to work on (optional, defaults to main)',
                },
              },
              required: ['description', 'repository'],
            },
          },
          {
            name: 'jules_get_task',
            description: 'Get details of a specific Jules task by ID or URL',
            inputSchema: {
              type: 'object',
              properties: {
                taskId: {
                  type: 'string',
                  description: 'Task ID or full Jules task URL',
                },
              },
              required: ['taskId'],
            },
          },
          {
            name: 'jules_list_tasks',
            description: 'List all Jules tasks with their status',
            inputSchema: {
              type: 'object',
              properties: {
                status: {
                  type: 'string',
                  enum: ['all', 'active', 'pending', 'completed', 'paused'],
                  description: 'Filter tasks by status',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of tasks to return (default 10)',
                },
              },
            },
          },
          {
            name: 'jules_send_message',
            description: 'Send a message/instruction to Jules in an active task',
            inputSchema: {
              type: 'object',
              properties: {
                taskId: {
                  type: 'string',
                  description: 'Task ID or URL',
                },
                message: {
                  type: 'string',
                  description: 'Message to send to Jules',
                },
              },
              required: ['taskId', 'message'],
            },
          },
          {
            name: 'jules_approve_plan',
            description: 'Approve Jules execution plan for a task',
            inputSchema: {
              type: 'object',
              properties: {
                taskId: {
                  type: 'string',
                  description: 'Task ID or URL',
                },
              },
              required: ['taskId'],
            },
          },
          {
            name: 'jules_resume_task',
            description: 'Resume a paused Jules task',
            inputSchema: {
              type: 'object',
              properties: {
                taskId: {
                  type: 'string',
                  description: 'Task ID or URL',
                },
              },
              required: ['taskId'],
            },
          },
          // === ADVANCED TASK OPERATIONS ===
          {
            name: 'jules_analyze_code',
            description: 'Analyze code changes and diff in a Jules task',
            inputSchema: {
              type: 'object',
              properties: {
                taskId: {
                  type: 'string',
                  description: 'Task ID or URL',
                },
                includeSourceCode: {
                  type: 'boolean',
                  description: 'Whether to include full source code content',
                },
              },
              required: ['taskId'],
            },
          },
          {
            name: 'jules_bulk_create_tasks',
            description: 'Create multiple tasks from a list of descriptions and repositories',
            inputSchema: {
              type: 'object',
              properties: {
                tasks: {
                  type: 'array',
                  items: {
                    type: 'object',
                    properties: {
                      description: { type: 'string' },
                      repository: { type: 'string' },
                      branch: { type: 'string' },
                    },
                    required: ['description', 'repository'],
                  },
                  description: 'Array of task objects to create',
                },
              },
              required: ['tasks'],
            },
          },
          // === SESSION & AUTHENTICATION MANAGEMENT ===
          {
            name: 'jules_session_info',
            description: 'Get current session configuration and authentication status',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
          {
            name: 'jules_setup_wizard',
            description: 'Interactive session setup wizard for automated Google authentication configuration',
            inputSchema: {
              type: 'object',
              properties: {
                environment: {
                  type: 'string',
                  enum: ['local', 'cloud', 'smithery', 'auto-detect'],
                  description: 'Deployment environment (auto-detect will analyze current setup)',
                },
                preferences: {
                  type: 'object',
                  properties: {
                    priority: {
                      type: 'string',
                      enum: ['ease-of-use', 'reliability', 'portability', 'performance'],
                      description: 'User priority for session management'
                    },
                    hasChrome: {
                      type: 'boolean',
                      description: 'Whether user has local Chrome browser access'
                    },
                    cloudDeployment: {
                      type: 'boolean', 
                      description: 'Whether deploying to cloud platforms'
                    }
                  }
                }
              },
            },
          },
          {
            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)',
                },
              },
            },
          },
          {
            name: 'jules_set_cookies',
            description: 'Set browser cookies from string or JSON for authentication',
            inputSchema: {
              type: 'object',
              properties: {
                cookies: {
                  type: 'string',
                  description: 'Cookies as JSON string or cookie string format',
                },
                format: {
                  type: 'string',
                  enum: ['json', 'string'],
                  description: 'Format of input cookies (default: json)',
                },
              },
              required: ['cookies'],
            },
          },
          // === DEBUGGING & UTILITIES ===
          {
            name: 'jules_screenshot',
            description: 'Take a screenshot of current Jules page for debugging and verification',
            inputSchema: {
              type: 'object',
              properties: {
                taskId: {
                  type: 'string',
                  description: 'Optional task ID to navigate to first',
                },
                filename: {
                  type: 'string',
                  description: 'Optional filename for screenshot',
                },
              },
            },
          },
        ],
      };
    });

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