Skip to main content
Glama
jonathan-politzki

Smartlead Simplified MCP Server

smartlead_get_all_folders

Retrieve a list of all email marketing folders with their details and contained tests, enabling organized management of campaign assets.

Instructions

Get the list and details of all folders created in Smart Delivery along with tests inside each folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of folders to retrieve (default: 10)
nameNoFilter folders by name
offsetNoOffset for pagination (default: 0)

Implementation Reference

  • The handler function that validates input parameters using isGetAllFoldersParams, constructs a SmartDelivery API client, builds query parameters for limit, offset, and optional name filter, fetches folders from `/spam-test/folder`, and returns formatted JSON response or error message.
    async function handleGetAllFolders(
      args: unknown, 
      apiClient: AxiosInstance,
      withRetry: <T>(operation: () => Promise<T>, context: string) => Promise<T>
    ) {
      if (!isGetAllFoldersParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for smartlead_get_all_folders'
        );
      }
    
      try {
        const smartDeliveryClient = createSmartDeliveryClient(apiClient);
        const { limit = 10, offset = 0, name = '' } = args;
        
        const queryParams = new URLSearchParams();
        queryParams.append('limit', limit.toString());
        queryParams.append('offset', offset.toString());
        if (name) {
          queryParams.append('name', name);
        }
        
        const response = await withRetry(
          async () => smartDeliveryClient.get(`/spam-test/folder?${queryParams.toString()}`),
          'get all folders'
        );
    
        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,
        };
      }
    }
  • Defines the tool metadata including name, description, category, and input schema for parameters limit (integer), offset (integer), and optional name (string). This schema is used for validation.
    export const GET_ALL_FOLDERS_TOOL: CategoryTool = {
      name: 'smartlead_get_all_folders',
      description: 'Get the list and details of all folders created in Smart Delivery along with tests inside each folder.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'integer',
            description: 'Number of folders to retrieve (default: 10)',
          },
          offset: {
            type: 'integer',
            description: 'Offset for pagination (default: 0)',
          },
          name: {
            type: 'string',
            description: 'Filter folders by name',
          },
        },
      },
    };
  • The switch case in the main SmartDelivery tool dispatcher that routes calls to 'smartlead_get_all_folders' to the handleGetAllFolders function.
    case 'smartlead_get_all_folders': {
      return handleGetAllFolders(args, apiClient, withRetry);
    }
  • The tool definition exported and included in the smartDeliveryTools array for registration in the MCP tool registry.
    export const GET_ALL_FOLDERS_TOOL: CategoryTool = {
      name: 'smartlead_get_all_folders',
      description: 'Get the list and details of all folders created in Smart Delivery along with tests inside each folder.',
      category: ToolCategory.SMART_DELIVERY,
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'integer',
            description: 'Number of folders to retrieve (default: 10)',
          },
          offset: {
            type: 'integer',
            description: 'Offset for pagination (default: 0)',
          },
          name: {
            type: 'string',
            description: 'Filter folders by name',
          },
        },
      },
    };
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 mentions retrieving 'list and details' and includes 'tests inside each folder', which gives some context about what data is returned. However, it doesn't address critical behaviors like pagination handling (implied by limit/offset parameters but not explained), rate limits, authentication requirements, error conditions, or whether this is a read-only operation (though 'Get' implies it).

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 states the core purpose upfront. It includes both the primary action (getting folders) and additional detail (including tests inside each folder) without unnecessary elaboration. However, it could be slightly more structured by separating the core function from additional features.

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 read operation with 3 parameters and 100% schema coverage but no output schema, the description provides adequate but minimal context. It specifies what's retrieved (folders with their tests) but doesn't describe the return format, data structure, or what 'details' include. With no annotations and no output schema, more behavioral context would be helpful for an agent to understand what to expect from the tool.

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 all three parameters (limit, name, offset) well-documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema. It mentions retrieving 'all folders' which might imply the name parameter filters this, but this is already clear from the schema. Baseline 3 is appropriate when 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' and the resources 'list and details of all folders created in Smart Delivery along with tests inside each folder.' It distinguishes from siblings like 'smartlead_get_folder_by_id' by specifying 'all folders' rather than a single folder, but doesn't explicitly contrast with other folder-related tools like 'smartlead_create_folder' or 'smartlead_delete_folder' beyond the verb difference.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention when to prefer this over 'smartlead_get_folder_by_id' for specific folder retrieval, or how it relates to other listing tools like 'smartlead_list_all_tests'. There's no context about prerequisites, timing, or constraints for usage.

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