Skip to main content
Glama

remove_from_block_list

Remove publisher URLs from an existing block list to refine ad placement exclusions.

Instructions

Remove publisher URLs from an existing block list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesBlock list ID
urlsYesJSON array of URLs to remove (e.g. '["example.com"]')

Implementation Reference

  • The handler function for 'remove_from_block_list' tool. It takes list_id and urls as parameters, makes a DELETE request to /{list_id}/publisher_urls with the urls payload, and returns the result.
    // ─── remove_from_block_list ───────────────────────────────────
    server.tool(
      "remove_from_block_list",
      "Remove publisher URLs from an existing block list.",
      {
        list_id: z.string().describe("Block list ID"),
        urls: z.string().describe("JSON array of URLs to remove (e.g. '[\"example.com\"]')"),
      },
      async ({ list_id, urls }) => {
        try {
          const { data, rateLimit } = await client.delete(`/${list_id}/publisher_urls`, { urls });
          return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...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 };
        }
      }
    );
  • Zod schema defining the input parameters for remove_from_block_list: list_id (string) and urls (string - JSON array of URLs to remove).
    server.tool(
      "remove_from_block_list",
      "Remove publisher URLs from an existing block list.",
      {
        list_id: z.string().describe("Block list ID"),
        urls: z.string().describe("JSON array of URLs to remove (e.g. '[\"example.com\"]')"),
      },
  • The registerBrandSafetyTools function that registers 'remove_from_block_list' (and other brand safety tools) on the MCP server via server.tool().
    export function registerBrandSafetyTools(server: McpServer, client: AdsClient): void {
      // ─── list_block_lists ─────────────────────────────────────────
      server.tool(
        "list_block_lists",
        "List publisher block lists for the ad account. Returns paginated results.",
        {
          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"),
        },
        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 };
          }
        }
      );
    
      // ─── create_block_list ────────────────────────────────────────
      server.tool(
        "create_block_list",
        "Create a new publisher block list for the ad account.",
        {
          name: z.string().describe("Name for the block list"),
        },
        async ({ name }) => {
          try {
            const params: Record<string, unknown> = { name };
            const { data, rateLimit } = await client.post(`${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 };
          }
        }
      );
    
      // ─── add_to_block_list ────────────────────────────────────────
      server.tool(
        "add_to_block_list",
        "Add publisher URLs to an existing block list.",
        {
          list_id: z.string().describe("Block list ID"),
          urls: z.string().describe("JSON array of URLs to block (e.g. '[\"example.com\",\"bad-site.com\"]')"),
        },
        async ({ list_id, urls }) => {
          try {
            const params: Record<string, unknown> = { urls };
            const { data, rateLimit } = await client.post(`/${list_id}/publisher_urls`, 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 };
          }
        }
      );
    
      // ─── remove_from_block_list ───────────────────────────────────
      server.tool(
        "remove_from_block_list",
        "Remove publisher URLs from an existing block list.",
        {
          list_id: z.string().describe("Block list ID"),
          urls: z.string().describe("JSON array of URLs to remove (e.g. '[\"example.com\"]')"),
        },
        async ({ list_id, urls }) => {
          try {
            const { data, rateLimit } = await client.delete(`/${list_id}/publisher_urls`, { urls });
            return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...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 };
          }
        }
      );
    
      // ─── delete_block_list ────────────────────────────────────────
      server.tool(
        "delete_block_list",
        "Delete a publisher block list. This action is irreversible.",
        {
          list_id: z.string().describe("Block list ID to delete"),
        },
        async ({ list_id }) => {
          try {
            const { data, rateLimit } = await client.delete(`/${list_id}`);
            return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, ...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:86-86 (registration)
    Registration call in the main index.ts that activates the brand safety tools (including remove_from_block_list) on the server.
    registerBrandSafetyTools(server, client);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.5/5.0
Behavior2/5

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

There are no annotations provided, so the description carries the full burden of behavioral disclosure. It only says 'Remove' without mentioning whether this is reversible, what happens to URLs not in the list, required permissions, or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is concise and front-loaded with the key verb and resource. No wasted words.

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

Completeness3/5

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

The tool is relatively simple with only two parameters and no output schema. However, the description lacks any guidance on expected behavior, return values, or error handling. It is minimally adequate but leaves room for improvement, especially given it is a mutation with no annotations.

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 description coverage is 100%, so the schema already fully describes both parameters (urls, list_id). The description adds no extra meaning beyond what the schema provides, hence a baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Remove'), the target resource ('publisher URLs'), and the context ('from an existing block list'). It distinguishes itself from sibling tools like add_to_block_list (opposite operation) and delete_block_list (deletes entire list).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when you need to remove specific URLs from a block list, but it does not explicitly state when to use this vs. alternatives (e.g., when to use delete_block_list instead) or mention prerequisites like the list must exist.

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