Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_lead

Retrieve detailed information about a specific lead by providing its unique ID, enabling access to contact data for email marketing campaigns.

Instructions

Get details of a specific lead by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lead_idYesID of the lead to retrieve

Implementation Reference

  • Core handler function for 'smartlead_get_lead': validates input parameters using isGetLeadParams, fetches lead details via API GET /leads/{lead_id} with retry logic, returns JSON-formatted response or error message.
    async function handleGetLead(
      args: unknown,
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isGetLeadParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_lead'
        );
      }
    
      try {
        const response = await withRetry(
          async () => apiClient.get(`/leads/${args.lead_id}`),
          'get lead'
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
          isError: false,
        };
      } catch (error: any) {
        return {
          content: [{ 
            type: 'text', 
            text: `API Error: ${error.response?.data?.message || error.message}` 
          }],
          isError: true,
        };
      }
    }
  • Tool definition including name, description, category, and input schema requiring 'lead_id' as a number.
    export const GET_LEAD_TOOL: CategoryTool = {
      name: 'smartlead_get_lead',
      description: 'Get details of a specific lead by ID.',
      category: ToolCategory.LEAD_MANAGEMENT,
      inputSchema: {
        type: 'object',
        properties: {
          lead_id: {
            type: 'number',
            description: 'ID of the lead to retrieve',
          },
        },
        required: ['lead_id'],
      },
    };
  • src/index.ts:207-209 (registration)
    Registers the array of lead tools (leadTools), which includes 'smartlead_get_lead', into the tool registry if leadManagement category is enabled.
    if (enabledCategories.leadManagement) {
      toolRegistry.registerMany(leadTools);
    }
  • Runtime type guard (validator) for GetLeadParams, ensuring 'lead_id' is present and a number.
    export function isGetLeadParams(args: unknown): args is GetLeadParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'lead_id' in args &&
        typeof (args as { lead_id: unknown }).lead_id === 'number'
      );
    }
  • src/index.ts:25-25 (registration)
    Imports the leadTools array containing the 'smartlead_get_lead' tool definition for registration.
    import { leadTools } from './tools/lead.js';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Get details' but doesn't clarify what details are returned, whether this is a read-only operation, if authentication is required, or any rate limits. This leaves significant gaps for an agent to understand the tool's behavior beyond basic purpose.

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, efficient sentence that states the core purpose without unnecessary words. It's front-loaded with the essential information ('Get details of a specific lead by ID'), making it easy to parse quickly.

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?

For a simple retrieval tool with one parameter and no output schema, the description is minimally adequate. However, it lacks context about what 'details' are returned, which could be important for an agent to understand the tool's utility. With no annotations and no output schema, more completeness would be beneficial.

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

Parameters3/5

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

The schema description coverage is 100%, with the single parameter 'lead_id' clearly documented as 'ID of the lead to retrieve'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for adequate but not enhanced coverage.

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 action ('Get details') and resource ('specific lead by ID'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'smartlead_list_leads' or 'smartlead_get_campaigns_by_lead', which also retrieve lead-related information but with different scopes or parameters.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios where retrieving a single lead by ID is preferable to listing all leads or filtering leads by campaign, nor does it reference sibling tools like 'smartlead_list_leads' for broader queries.

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/jonathan-politzki/smartlead-mcp-server'

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