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;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool checks for leads needing welcome emails, but doesn't describe what 'check' entails (e.g., returns a list, triggers notifications, requires authentication, has rate limits, or what happens if no leads are found). For a tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence: 'Check for new leads added in last 24 hours that need welcome emails.' It is front-loaded with the core purpose, has no redundant words, and efficiently conveys the essential information without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations, no output schema, and 0 parameters, the description provides a basic purpose but lacks details on behavior, return values, or error handling. It's minimally adequate for a simple check operation but doesn't fully compensate for the absence of structured data, leaving gaps in understanding how the tool functions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description doesn't add parameter details, which is appropriate since there are no parameters to describe. This aligns with the baseline expectation for zero-parameter tools, where minimal param info is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Check for new leads added in last 24 hours that need welcome emails.' It specifies the verb ('check'), resource ('new leads'), and temporal scope ('last 24 hours'), though it doesn't explicitly differentiate from sibling tools like 'get_metrics' or 'get_pipeline' which might also retrieve lead data. The purpose is specific but lacks sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context: it should be used when checking for recent leads requiring welcome emails. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_metrics' or 'update_lead', nor does it mention prerequisites or exclusions. The usage is implied but not fully articulated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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