log_outreach
Record outreach activities in your revenue pipeline by tracking communication channels, responses, and follow-up notes for lead management.
Instructions
Log an outreach activity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| leadId | No | ||
| companyName | Yes | ||
| channel | Yes | ||
| templateUsed | No | ||
| templateId | No | ||
| responseReceived | No | ||
| responseType | No | ||
| notes | No |
Implementation Reference
- index.js:646-648 (handler)Handler for the log_outreach tool. Dispatches the tool call to the callAPI function with action 'logOutreach' and the provided arguments.case "log_outreach": result = await callAPI("logOutreach", args); break;
- index.js:216-239 (registration)Registration of the log_outreach tool in the tools list, including name, description, and input schema definition.{ name: "log_outreach", description: "Log an outreach activity", inputSchema: { type: "object", properties: { leadId: { type: "number" }, companyName: { type: "string" }, channel: { type: "string", enum: ["Cold Email", "LinkedIn", "Upwork", "Phone", "Gmail", "Other"] }, templateUsed: { type: "string" }, templateId: { type: "number" }, responseReceived: { type: "string", enum: ["Yes", "No"] }, responseType: { type: "string", enum: ["Interested", "Not Interested", "Question", "Meeting Booked", "No Response"] }, notes: { type: "string" }, }, required: ["companyName", "channel"], }, },
- index.js:219-238 (schema)Input schema for the log_outreach tool, defining parameters like leadId, companyName, channel, etc.inputSchema: { type: "object", properties: { leadId: { type: "number" }, companyName: { type: "string" }, channel: { type: "string", enum: ["Cold Email", "LinkedIn", "Upwork", "Phone", "Gmail", "Other"] }, templateUsed: { type: "string" }, templateId: { type: "number" }, responseReceived: { type: "string", enum: ["Yes", "No"] }, responseType: { type: "string", enum: ["Interested", "Not Interested", "Question", "Meeting Booked", "No Response"] }, notes: { type: "string" }, }, required: ["companyName", "channel"], },
- index.js:74-131 (helper)Helper function callAPI that handles HTTP POST requests to the Google Apps Script API endpoint with the action and arguments. This is where the actual API call for logOutreach is made.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; } }