Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

list_files

Retrieve all files from the Mailchimp File Manager to manage and access stored assets for email campaigns.

Instructions

List all files in the File Manager

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic for the "list_files" tool within the handleToolCall switch statement. It invokes service.listFiles(), maps the files to a simplified structure (id, name, size, created_at), and returns formatted JSON text content as per MCP tool response format.
    case "list_files": const files = await service.listFiles(); return { content: [ { type: "text", text: JSON.stringify( files.files.map((f) => ({ id: f.id, name: f.name, size: f.size, created_at: f.created_at, })), null, 2 ), }, ], };
  • Registration of the "list_files" tool in the getToolDefinitions function. Defines the tool name, description, and empty input schema (no parameters required). This array is used to expose tools to the MCP server.
    { name: "list_files", description: "List all files in the File Manager", inputSchema: { type: "object", properties: {}, required: [], }, },
  • TypeScript interface defining the structure of a MailchimpFile, used in the return type of listFiles() and mapped in the handler response.
    export interface MailchimpFile { id: string; folder_id: string; name: string; file_data: string; type: string; size: number; created_at: string; created_by: string; _links?: Array<{ rel: string; href: string; method: string; targetSchema?: string; schema?: string; }>; }
  • Core helper method in MailchimpService that performs a paginated GET request to the Mailchimp File Manager API endpoint '/file-manager/files', sorted by created_at descending.
    async listFiles(): Promise<{ files: MailchimpFile[] }> { return await this.makePaginatedRequest( "/file-manager/files", "created_at", "DESC" ); }

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/AgentX-ai/mailchimp-mcp'

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