Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_email_content

Retrieve email content details including raw and HTML versions along with campaign and sequence information for a specific spam test ID.

Instructions

Get details for the email content (raw, HTML) along with campaign and sequence details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the spam test to get the email content for

Implementation Reference

  • Core execution logic for the smartlead_get_email_content tool. Validates arguments using isEmailContentParams, calls the SmartDelivery API GET /spam-test/report/{spam_test_id}/email-content endpoint, and formats the response as MCP tool result.
    async function handleGetEmailContent(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isEmailContentParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_email_content'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { spam_test_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/email-content`),
          'get email content'
        );
    
        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 schema definition specifying the name, description, category, and input schema (requires spam_test_id as integer). Used for MCP tool registration and validation.
    export const GET_EMAIL_CONTENT_TOOL: CategoryTool = {
      name: 'smartlead_get_email_content',
      description: 'Get details for the email content (raw, HTML) along with campaign and sequence details.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          spam_test_id: {
            type: 'integer',
            description: 'ID of the spam test to get the email content for',
          },
        },
        required: ['spam_test_id'],
      },
    };
  • src/index.ts:217-219 (registration)
    Registers the array of smartDeliveryTools (including smartlead_get_email_content schema) to the MCP tool registry if smartDelivery category is license-enabled.
    if (enabledCategories.smartDelivery) {
      toolRegistry.registerMany(smartDeliveryTools);
    }
  • Runtime type guard function isEmailContentParams used in the handler for input validation, matching the tool inputSchema.
    export function isEmailContentParams(args: unknown): args is EmailContentParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'spam_test_id' in args &&
        typeof (args as EmailContentParams).spam_test_id === 'number'
      );
    }
  • src/index.ts:354-356 (registration)
    Registers the category dispatcher handleSmartDeliveryTool for all SMART_DELIVERY tools, which routes to specific handlers based on tool name.
    case ToolCategory.SMART_DELIVERY:
      return await handleSmartDeliveryTool(name, toolArgs, apiClient, withRetry);
    case ToolCategory.WEBHOOKS:
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. While 'Get details' implies a read-only operation, it doesn't specify authentication requirements, rate limits, error conditions, or what 'details' include beyond raw/HTML content. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately front-loaded with the core action, though it could be slightly more structured by separating content types from campaign details.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It mentions retrieving 'details' but doesn't specify what those details include beyond raw/HTML content, nor does it address behavioral aspects like response format or error handling. For a tool in a complex domain with many siblings, this leaves too much undefined.

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 input schema has 100% description coverage, fully documenting the single required parameter 'spam_test_id'. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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 the resource ('email content, campaign and sequence details'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from similar siblings like 'smartlead_get_spam_test_details' or 'smartlead_get_email_headers', which might also retrieve email-related information.

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. With many sibling tools dealing with email content, campaigns, and sequences, there's no indication of prerequisites, specific use cases, or exclusions that would help an agent choose appropriately.

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