Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_email_headers

Retrieve detailed email header information for specific spam tests and replies to analyze email delivery and authentication data.

Instructions

Get details of the email headers for a specific email.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reply_idYesID of the email received by the seed account
spam_test_idYesID of the spam test

Implementation Reference

  • The handler function that performs input validation and makes the API call to retrieve email headers for the specified spam test and reply ID.
    async function handleGetEmailHeaders(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isEmailHeadersParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_email_headers'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { spam_test_id, reply_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.get(`/spam-test/report/${spam_test_id}/sender-account-wise/${reply_id}/email-headers`),
          'get email headers'
        );
    
        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,
        };
      }
    }
  • Schema definition for the tool, specifying input parameters spam_test_id and reply_id.
    export const GET_EMAIL_HEADERS_TOOL: CategoryTool = {
      name: 'smartlead_get_email_headers',
      description: 'Get details of the email headers for a specific email.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          spam_test_id: {
            type: 'integer',
            description: 'ID of the spam test',
          },
          reply_id: {
            type: 'integer',
            description: 'ID of the email received by the seed account',
          },
        },
        required: ['spam_test_id', 'reply_id'],
      },
    };
  • src/index.ts:216-219 (registration)
    Registration of all smartDeliveryTools (including this tool) into the tool registry if the smartDelivery category is enabled.
    // Register smart delivery tools if enabled
    if (enabledCategories.smartDelivery) {
      toolRegistry.registerMany(smartDeliveryTools);
    }
  • Switch case in handleSmartDeliveryTool that routes to the specific handler for this tool.
    case 'smartlead_get_email_headers': {
      return handleGetEmailHeaders(args, apiClient, withRetry);
    }
  • src/index.ts:354-355 (registration)
    Main tool dispatcher switch case that routes SMART_DELIVERY category tools to handleSmartDeliveryTool.
    case ToolCategory.SMART_DELIVERY:
      return await handleSmartDeliveryTool(name, toolArgs, apiClient, withRetry);
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 states it 'gets details' but doesn't clarify if this is a read-only operation, what the output format might be, or any limitations like rate limits or authentication needs. This leaves significant gaps for a tool with two required parameters.

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 with no wasted words, making it easy to parse. It's appropriately sized for a simple tool, though it could benefit from more detail given the lack of annotations.

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 complexity (2 required parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, any behavioral traits, or usage context, leaving the agent with insufficient information to use it effectively beyond the basic schema.

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, clearly documenting both parameters (reply_id and spam_test_id) with their types and purposes. The description doesn't add any extra meaning beyond this, 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 verb ('Get details') and resource ('email headers for a specific email'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'smartlead_get_email_content' or 'smartlead_get_spam_test_details', which might also retrieve email-related data, so it's not fully distinct.

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, such as other email-related tools in the sibling list. It lacks context about prerequisites, like needing a spam test ID and reply ID, or when this is preferred over similar tools.

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