Skip to main content
Glama

check_new_leads

Identify recent leads requiring welcome emails within the last 24 hours to initiate timely engagement.

Instructions

Check for new leads added in last 24 hours that need welcome emails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'check_new_leads' that calls the callAPI helper with action 'checkNewLeads', proxying to the remote Google Apps Script.
    case "check_new_leads": result = await callAPI("checkNewLeads"); break;
  • Input schema definition for the 'check_new_leads' tool (no required parameters).
    { name: "check_new_leads", description: "Check for new leads added in last 24 hours that need welcome emails", inputSchema: { type: "object", properties: {} } },
  • index.js:378-385 (registration)
    Tool registration in the ListTools response, including name, description, and schema.
    { name: "check_new_leads", description: "Check for new leads added in last 24 hours that need welcome emails", inputSchema: { type: "object", properties: {} } },
  • Reusable helper function that performs HTTP POST requests to the Google Apps Script backend (API_URL), handling all tool actions including 'checkNewLeads'. This contains the core proxy logic for remote tool execution.
    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; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PromptishOperations/mcpSpec'

If you have feedback or need assistance with the MCP directory API, please join our Discord server