Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_spam_test_details

Retrieve detailed results for a specific email spam test to analyze deliverability and identify potential inbox placement issues.

Instructions

Retrieve details of a specific spam test by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spam_test_idYesID of the spam test to retrieve details for

Implementation Reference

  • Core handler function that validates input parameters, makes API call to retrieve spam test details from SmartDelivery endpoint `/spam-test/${spam_test_id}`, formats response as MCP content, and handles errors.
    async function handleGetSpamTestDetails(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isGetSpamTestDetailsParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_spam_test_details'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { spam_test_id } = args;
        
        const response = await withRetry(
          async () => smartDeliveryClient.get(`/spam-test/${spam_test_id}`),
          'get spam test details'
        );
    
        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,
        };
      }
    }
  • MCP tool definition including name, description, category, and JSON schema for input validation (requires spam_test_id as integer).
    export const GET_SPAM_TEST_DETAILS_TOOL: CategoryTool = {
      name: 'smartlead_get_spam_test_details',
      description: 'Retrieve details of a specific spam test by ID.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          spam_test_id: {
            type: 'integer',
            description: 'ID of the spam test to retrieve details for',
          },
        },
        required: ['spam_test_id'],
      },
    };
  • TypeScript type guard function used in the handler to validate input arguments against GetSpamTestDetailsParams interface (checks for spam_test_id number).
    export function isGetSpamTestDetailsParams(args: unknown): args is GetSpamTestDetailsParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'spam_test_id' in args &&
        typeof (args as GetSpamTestDetailsParams).spam_test_id === 'number'
      );
    }
  • Switch case in handleSmartDeliveryTool that registers and dispatches the tool call to the specific handler function.
    case 'smartlead_get_spam_test_details': {
      return handleGetSpamTestDetails(args, 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 a read operation ('retrieve'), implying it's likely non-destructive, but doesn't specify authentication needs, rate limits, error handling, or the format of returned details. This leaves significant gaps for a tool that presumably returns data.

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 directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for a simple retrieval operation.

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's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavioral aspects like response format or error cases, which would be helpful for an agent to use it effectively.

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?

Schema description coverage is 100%, with the single parameter 'spam_test_id' fully documented in the schema. The description adds no additional meaning beyond implying retrieval by ID, so it meets the baseline score 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 ('retrieve details') and resource ('spam test'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'smartlead_list_all_tests' or 'smartlead_get_spam_filter_details', which might offer related functionality, so it doesn't reach the highest score.

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 'smartlead_list_all_tests' for listing tests or other 'get_' tools for different details. It lacks context on prerequisites or exclusions, leaving the agent to infer usage from the name alone.

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