get_matrix_row
Retrieve all topics for a specific date from the revenue tracking matrix to access complete daily data for business management.
Instructions
Get all topics for a specific date. Returns complete row from Matrix.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date in YYYY-MM-DD format (defaults to today) |
Implementation Reference
- index.js:441-453 (registration)Registration of the 'get_matrix_row' tool in the ListTools response, including name, description, and input schema.{ name: "get_matrix_row", description: "Get all topics for a specific date. Returns complete row from Matrix.", inputSchema: { type: "object", properties: { date: { type: "string", description: "Date in YYYY-MM-DD format (defaults to today)" } } } },
- index.js:444-452 (schema)Input schema definition for the 'get_matrix_row' tool, specifying optional 'date' parameter.inputSchema: { type: "object", properties: { date: { type: "string", description: "Date in YYYY-MM-DD format (defaults to today)" } } }
- index.js:707-709 (handler)Tool handler that delegates execution to the external API via callAPI('getMatrixRow', args).case "get_matrix_row": result = await callAPI("getMatrixRow", args); break;
- index.js:74-131 (helper)Helper function callAPI used by all tools (including get_matrix_row) to proxy requests to the Google Apps Script backend at the specified API_URL.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; } }