get_tasks
Retrieve all tasks from your revenue management system to track progress, manage workflows, and monitor business operations across your pipeline.
Instructions
Get all tasks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:280-288 (registration)Registration of the 'get_tasks' tool in the ListTools response, including name, description, and input schema.{ name: "get_tasks", description: "Get all tasks", inputSchema: { type: "object", properties: {}, }, }, {
- index.js:283-286 (schema)Input schema for the 'get_tasks' tool: accepts no parameters (empty object).inputSchema: { type: "object", properties: {}, },
- index.js:658-660 (handler)Handler implementation for 'get_tasks': delegates to external API via callAPI('getTasks'), which makes a POST request to the Google Apps Script endpoint.case "get_tasks": result = await callAPI("getTasks"); break;
- index.js:74-131 (helper)Helper function callAPI used by get_tasks handler to make HTTP POST requests to the backend Google Apps Script API.async function callAPI(action, data = {}) { debugLog('=== API CALL START ==='); debugLog(`Action: ${action}`); debugLog(`Data: ${JSON.stringify(data)}`); try { // Build form-encoded body for POST const formData = new URLSearchParams(); formData.append('action', action); // Add all data fields to form for (const [key, value] of Object.entries(data)) { if (value !== undefined && value !== null) { formData.append(key, value.toString()); } } const formString = formData.toString(); debugLog(`FormData: ${formString}`); debugLog(`API_URL: ${API_URL}`); // Use POST with proper content type const response = await fetch(API_URL, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: formString }); debugLog(`Response status: ${response.status}`); debugLog(`Response ok: ${response.ok}`); if (!response.ok) { debugLog(`Response not OK: ${response.status} ${response.statusText}`); throw new Error(`API request failed: ${response.status} ${response.statusText}`); } const text = await response.text(); debugLog(`Response text length: ${text.length}`); debugLog(`Response text: ${text}`); if (!text) { debugLog('ERROR: Empty response from API'); throw new Error('Empty response from API'); } const parsed = JSON.parse(text); debugLog(`Parsed successfully: ${JSON.stringify(parsed)}`); debugLog('=== API CALL END ==='); return parsed; } catch (error) { debugLog(`ERROR in callAPI: ${error.message}`); debugLog(`ERROR stack: ${error.stack}`); throw error; } }