get_feed_uploads
Get upload history for a product feed to monitor past uploads and track feed status.
Instructions
Get upload history for a product feed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feed_id | Yes | Product feed ID | |
| fields | No | Comma-separated fields to return | |
| limit | No | Number of results to return | |
| after | No | Pagination cursor for next page |
Implementation Reference
- src/tools/feeds.ts:65-82 (handler)Registers the 'get_feed_uploads' tool on the MCP server. The handler accepts feed_id, optional fields, limit, and after parameters, makes a GET request to /{feed_id}/uploads, and returns the upload history data with rate limit info.
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/tools/feeds.ts:68-73 (schema)Zod schema for the tool's input parameters: feed_id (required string), fields (optional string), limit (optional number, default 25), after (optional string for pagination).
{ 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"), }, - src/tools/feeds.ts:65-82 (registration)Tool is registered via server.tool() as part of the registerFeedTools function, which takes an McpServer and AdsClient as dependencies.
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/tools/feeds.ts:1-3 (helper)Imports: zod for schema validation, McpServer from the MCP SDK, and AdsClient from the services layer.
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { AdsClient } from "../services/ads-client.js";