list_block_lists
Retrieve publisher block lists for your ad account, with support for pagination and custom fields.
Instructions
List publisher block lists for the ad account. Returns paginated results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Comma-separated fields to return | |
| limit | No | Number of results (default 25) | |
| after | No | Pagination cursor for next page |
Implementation Reference
- src/tools/brand_safety.ts:15-27 (handler)Handler for the list_block_lists tool. Makes a GET request to {accountPath}/publisher_block_lists with optional fields, limit, and after pagination parameters. Returns JSON stringified data with rate limit info.
async ({ fields, limit, after }) => { try { const params: Record<string, unknown> = {}; if (fields) params.fields = fields; if (limit) params.limit = limit; if (after) params.after = after; const { data, rateLimit } = await client.get(`${client.accountPath}/publisher_block_lists`, 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/brand_safety.ts:10-14 (schema)Input schema for list_block_lists: fields (optional string), limit (optional number, default 25), after (optional string for pagination cursor).
{ fields: z.string().optional().describe("Comma-separated fields to return"), limit: z.number().optional().default(25).describe("Number of results (default 25)"), after: z.string().optional().describe("Pagination cursor for next page"), }, - src/tools/brand_safety.ts:7-8 (registration)Registration of the list_block_lists tool via server.tool() with description 'List publisher block lists for the ad account. Returns paginated results.'
server.tool( "list_block_lists", - src/index.ts:86-86 (registration)Call to registerBrandSafetyTools which registers list_block_lists among other brand safety tools.
registerBrandSafetyTools(server, client); - src/services/ads-client.ts:213-215 (helper)The accountPath getter used by list_block_lists handler to construct the API endpoint URL (returns '/act_{adAccountId}').
get accountPath(): string { return `/act_${this.accountId}`; }