setup_matrix_sheet
Initialize a structured Knowledge Matrix sheet with predefined headers to organize revenue tracking data for pipeline management and business operations.
Instructions
Auto-create Knowledge Matrix sheet with proper structure and headers. Run this once before using other Matrix tools.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "setup_matrix_sheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:695-697 (handler)Handler implementation for the 'setup_matrix_sheet' tool. Dispatches the call to the Google Apps Script backend via the shared callAPI function with action 'setupMatrixSheet'.
case "setup_matrix_sheet": result = await callAPI("setupMatrixSheet"); break; - index.js:389-395 (registration)Tool registration in the ListTools response, including name, description, and empty input schema (no parameters required).
name: "setup_matrix_sheet", description: "Auto-create Knowledge Matrix sheet with proper structure and headers. Run this once before using other Matrix tools.", inputSchema: { type: "object", properties: {} } }, - index.js:391-394 (schema)Input schema definition for the tool: an empty object (no input parameters).
inputSchema: { type: "object", properties: {} } - index.js:74-131 (helper)Shared helper function callAPI that all matrix tools (including setup_matrix_sheet) use to proxy requests to the Google Apps Script backend.
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; } }