google_tasks_set_default_list
Set a specific task list as the default for operations in Google MCP, streamlining task management and ensuring consistent execution across workflows.
Instructions
Set the default task list ID for operations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskListId | Yes | The ID of the task list to set as default |
Implementation Reference
- handlers/tasks.ts:15-28 (handler)The handler function that validates the input arguments and invokes the GoogleTasks.setDefaultTaskList method to set the default task list ID, returning a formatted response.export async function handleTasksSetDefaultList( args: any, googleTasksInstance: GoogleTasks ) { if (!isSetDefaultTaskListArgs(args)) { throw new Error("Invalid arguments for google_tasks_set_default_list"); } const { taskListId } = args; const result = googleTasksInstance.setDefaultTaskList(taskListId); return { content: [{ type: "text", text: result }], isError: false, }; }
- tools/tasks/index.ts:1-16 (schema)The Tool schema definition specifying the name, description, and input schema for the google_tasks_set_default_list tool.import { type Tool } from "@modelcontextprotocol/sdk/types.js"; export const SET_DEFAULT_TASKLIST_TOOL: Tool = { name: "google_tasks_set_default_list", description: "Set the default task list ID for operations", inputSchema: { type: "object", properties: { taskListId: { type: "string", description: "The ID of the task list to set as default", }, }, required: ["taskListId"], }, };
- server-setup.ts:213-217 (registration)The switch case in the main tool request handler that registers and routes calls to the specific tasks handler.case "google_tasks_set_default_list": return await tasksHandlers.handleTasksSetDefaultList( args, googleTasksInstance );
- utils/tasks.ts:12-15 (helper)The core utility method in the GoogleTasks class that updates the default task list ID and returns a confirmation message.setDefaultTaskList(taskListId: string) { this.defaultTaskList = taskListId; return `Default task list ID set to: ${taskListId}`; }
- utils/helper.ts:317-321 (helper)Type guard helper function that validates the input arguments match the expected shape for the tool.export function isSetDefaultTaskListArgs(args: any): args is { taskListId: string; } { return args && typeof args.taskListId === "string"; }