Skip to main content
Glama

upload_feed

Trigger a product feed upload by supplying a feed ID and the URL of the feed file.

Instructions

Upload/trigger a feed file upload for a product feed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feed_idYesProduct feed ID
urlYesURL of the feed file to upload

Implementation Reference

  • The 'upload_feed' tool handler: registers an MCP tool named 'upload_feed' with schema (feed_id, url) that calls client.post(`/${feed_id}/uploads`).
    // ─── upload_feed ───────────────────────────────────────────
    server.tool(
      "upload_feed",
      "Upload/trigger a feed file upload for a product feed.",
      {
        feed_id: z.string().describe("Product feed ID"),
        url: z.string().describe("URL of the feed file to upload"),
      },
      async ({ feed_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.post(`/${feed_id}/uploads`, { ...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 };
        }
      }
    );
  • Input schema for 'upload_feed': requires feed_id (string) and url (string).
    {
      feed_id: z.string().describe("Product feed ID"),
      url: z.string().describe("URL of the feed file to upload"),
    },
  • The registerFeedTools function that registers all feed tools (including upload_feed) on an McpServer instance.
    export function registerFeedTools(server: McpServer, client: AdsClient): void {
      // ─── list_feeds ────────────────────────────────────────────
      server.tool(
        "list_feeds",
        "List product feeds for a catalog.",
        {
          catalog_id: z.string().describe("Product catalog ID"),
          fields: z.string().optional().describe("Comma-separated fields to return"),
          limit: z.number().optional().default(25).describe("Number of results to return"),
          after: z.string().optional().describe("Pagination cursor for next page"),
        },
        async ({ catalog_id, ...params }) => {
          try {
            const { data, rateLimit } = await client.get(`/${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 };
          }
        }
      );
    
      // ─── 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 };
          }
        }
      );
    
      // ─── upload_feed ───────────────────────────────────────────
      server.tool(
        "upload_feed",
        "Upload/trigger a feed file upload for a product feed.",
        {
          feed_id: z.string().describe("Product feed ID"),
          url: z.string().describe("URL of the feed file to upload"),
        },
        async ({ feed_id, ...params }) => {
          try {
            const { data, rateLimit } = await client.post(`/${feed_id}/uploads`, { ...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 };
          }
        }
      );
    
      // ─── get_feed_uploads ──────────────────────────────────────
      server.tool(
        "get_feed_uploads",
        "Get upload history for a product feed.",
        {
          feed_id: z.string().describe("Product feed ID"),
          fields: z.string().optional().describe("Comma-separated fields to return"),
          limit: z.number().optional().default(25).describe("Number of results to return"),
          after: z.string().optional().describe("Pagination cursor for next page"),
        },
        async ({ feed_id, ...params }) => {
          try {
            const { data, rateLimit } = await client.get(`/${feed_id}/uploads`, { ...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/index.ts:72-72 (registration)
    Top-level registration: registerFeedTools(server, client) called in the main entrypoint.
    registerFeedTools(server, client);
  • The AdsClient.post method used by the upload_feed handler to make POST requests to the Meta Ads API.
    async post(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("POST", path, params);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description merely states 'upload/trigger a feed file upload' without revealing behavioral details like whether it initiates an asynchronous process, requires specific permissions, or has side effects. With no annotations, the description carries the full burden for transparency and falls short.

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 concise sentence with no extraneous information. It is efficiently structured and easy to read, though it lacks depth.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the schema covers the parameters, the description does not explain what the tool returns (no output schema), nor does it differentiate from sibling tools like 'create_feed' or 'get_feed_uploads.' The agent is left without enough context to use it correctly.

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 coverage is 100%, so the baseline is 3. The description does not add any additional meaning to the parameters beyond what the schema already provides (e.g., 'feed_id' and 'url').

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 uses the verb 'upload/trigger' and identifies the resource as 'feed file upload for a product feed,' making the main action clear. However, it does not distinguish this tool from siblings like 'create_feed' or 'upload_image,' which could lead to confusion.

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 about when to use this tool vs. alternatives such as 'create_feed' or 'get_feed_uploads.' There is no mention of prerequisites, context, or conditions for invocation.

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/mikusnuz/meta-ads-mcp'

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