Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

list_files

Retrieve all files stored in Mailchimp's File Manager to access uploaded images, documents, and media for email campaigns.

Instructions

List all files in the File Manager

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_files' tool. It invokes the service.listFiles() method and formats the list of files into a JSON string response for the MCP tool call.
    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 ), }, ], };
  • The tool schema definition, specifying the name, description, and input schema (no required parameters). This is part of the tool registrations returned by getToolDefinitions.
    { name: "list_files", description: "List all files in the File Manager", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Helper method in MailchimpService that performs a paginated GET request to the Mailchimp File Manager API endpoint to retrieve the list of files.
    async listFiles(): Promise<{ files: MailchimpFile[] }> { return await this.makePaginatedRequest( "/file-manager/files", "created_at", "DESC" ); }
  • TypeScript interface defining the structure of file objects returned by the Mailchimp File Manager API, used for type safety in the service layer.
    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; }>; }
  • src/index.ts:42-46 (registration)
    MCP server registration for listing tools. Returns all tool definitions (including list_files) via getToolDefinitions when ListTools is called.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getToolDefinitions(mailchimpService), }; });

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