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);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for disclosing side effects. It fails to mention whether the upload is asynchronous, whether it requires an existing feed, what the response contains, or any permission requirements.

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 fluff. The phrase 'Upload/trigger' is slightly redundant, but it remains short and front-loaded with the action.

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?

For a simple upload tool with no output schema, the description is incomplete. It does not explain the upload lifecycle, how to check status, or what constitutes successful execution, leaving the agent to guess.

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?

The input schema already provides descriptions for both parameters (feed_id and url) with 100% coverage. The description adds no extra meaning beyond what the schema states, so the baseline score of 3 applies.

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 'Upload/trigger a feed file upload for a product feed' clearly states the action (upload/trigger) and the resource (feed file). It is specific enough to distinguish from list/read feed tools, though it does not explicitly contrast with create_feed.

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 like create_feed or get_feed_uploads. There is no mention of prerequisites, typical scenarios, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools