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);
Behavior2/5

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

No annotations are provided, so the description must fully convey behavioral traits. It only states the mutation (removal) but omits side effects, authorization needs, idempotency, or response behavior.

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 conveys the essential purpose without any extraneous words. It is front-loaded and efficient.

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?

Given no output schema, the description should clarify return behavior (e.g., confirmation of removal or errors) but does not. However, with only two simple parameters and full schema coverage, it is minimally adequate.

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% (both parameters have clear descriptions). The tool description adds no extra meaning beyond the schema, achieving the 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 resource ('publisher URLs'), and the target ('existing block list'). It is specific and distinguishes from siblings like 'add_to_block_list' and 'create_block_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?

No explicit guidance on when to use this tool versus alternatives, nor prerequisites or exclusions. The usage is implied by the name and description but lacks context for a non-expert agent.

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