create_feed
Create a product feed for a catalog by providing catalog ID, feed name, schedule, and file URL.
Instructions
Create a new product feed for a catalog.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog_id | Yes | Product catalog ID | |
| name | Yes | Feed name | |
| schedule | No | JSON string for feed schedule configuration | |
| file_url | No | URL of the feed file |
Implementation Reference
- src/tools/feeds.ts:26-44 (handler)The create_feed tool handler - registered via server.tool(), accepts catalog_id, name, schedule (optional JSON string), and file_url (optional). Makes a POST to /{catalog_id}/product_feeds via the AdsClient.
// ─── create_feed ─────────────────────────────────────────── server.tool( "create_feed", "Create a new product feed for a catalog.", { catalog_id: z.string().describe("Product catalog ID"), name: z.string().describe("Feed name"), schedule: z.string().optional().describe("JSON string for feed schedule configuration"), file_url: z.string().optional().describe("URL of the feed file"), }, async ({ catalog_id, ...params }) => { try { const { data, rateLimit } = await client.post(`/${catalog_id}/product_feeds`, { ...params }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/feeds.ts:30-35 (schema)Zod schema for create_feed input: catalog_id (string), name (string), schedule (optional string), file_url (optional string).
{ catalog_id: z.string().describe("Product catalog ID"), name: z.string().describe("Feed name"), schedule: z.string().optional().describe("JSON string for feed schedule configuration"), file_url: z.string().optional().describe("URL of the feed file"), }, - src/tools/feeds.ts:5-6 (registration)The registerFeedTools function that registers all feed tools (including create_feed) on the MCP server.
export function registerFeedTools(server: McpServer, client: AdsClient): void { // ─── list_feeds ──────────────────────────────────────────── - src/index.ts:72-72 (registration)Where registerFeedTools is called to register feed tools (including create_feed) on the MCP server.
registerFeedTools(server, client); - src/services/ads-client.ts:187-192 (helper)The AdsClient.post() method used by the create_feed handler to make the HTTP POST request to the Meta Ads API.
async post( path: string, params?: Record<string, unknown> ): Promise<ClientResponse> { return this.request("POST", path, params); }