Skip to main content
Glama

remove_users_from_audience

Remove users from a custom audience by providing audience ID and a payload of SHA-256 hashed identifiers. Maintain precise audience control for ad targeting.

Instructions

Remove users from a custom audience. Payload format is the same as add_users_to_audience.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audience_idYesAudience ID
payloadYesJSON string: {schema: ['EMAIL','PHONE',...], data: [['hash1','hash2',...], ...]}. All PII must be SHA-256 hashed.

Implementation Reference

  • Registers the 'remove_users_from_audience' tool with server.tool(), defining its schema and handler.
    );
    
    // ─── remove_users_from_audience ────────────────────────────
  • Input schema: requires audience_id (string) and payload (string - JSON with schema and data arrays).
    {
      audience_id: z.string().describe("Audience ID"),
      payload: z.string().describe("JSON string: {schema: ['EMAIL','PHONE',...], data: [['hash1','hash2',...], ...]}. All PII must be SHA-256 hashed."),
    },
  • Handler function that sends a DELETE request to /{audience_id}/users and returns the response or error.
    async ({ audience_id, payload }) => {
      try {
        const { data, rateLimit } = await client.delete(`/${audience_id}/users`, { payload });
        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 };
      }
    }
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only states the action and references the payload format. Crucially, it does not mention whether the removal is destructive, reversible, requires specific permissions, or returns any status. The minimal description fails to inform the agent about important behavioral traits beyond the basic action.

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 extremely concise: two sentences with no fluff. The purpose is front-loaded in the first sentence, and the second adds a useful reference. Every word earns its place, making it efficient for an AI agent to parse.

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?

Given the lack of annotations and output schema, the description is incomplete. It omits return values, error handling, idempotency, and behavioral side effects. While the parameters are fully documented in the schema, the tool's overall usage context (e.g., when removal takes effect, success indicators) is missing, leaving significant gaps for an agent to use it correctly.

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 coverage is 100%, so the baseline is 3. The description adds modest value by cross-referencing the payload format to add_users_to_audience, which may help the agent understand consistency expectations. However, it does not elaborate on parameter meaning beyond what the schema already defines (audience_id and payload with format description).

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 'Remove users from a custom audience', which is a specific verb-resource pair. It directly distinguishes itself from sibling tools like add_users_to_audience (add) and update_audience (modify settings). The purpose is unambiguous and immediately actionable.

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

Usage Guidelines4/5

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

The description implies usage context by referencing add_users_to_audience for payload format, implying that this tool is the removal counterpart. However, it does not provide explicit when-to-use or when-not-to-use criteria, prerequisites, or consequences. The sibling tool add_users_to_audience serves as an implicit alternative, but no direct comparison is made.

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