Skip to main content
Glama

list_system_users

Retrieve system users for your Meta Business account. Specify fields, limit results, and paginate through data.

Instructions

List system users of the configured business. Requires META_BUSINESS_ID env var.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNoComma-separated fields to return
limitNoNumber of results (default 25)
afterNoPagination cursor for next page

Implementation Reference

  • Registration of the 'list_system_users' tool on the MCP server via server.tool(), defining its schema (fields, limit, after) and handler.
    // ─── list_system_users ────────────────────────────────────────
    server.tool(
      "list_system_users",
      "List system users of the configured business. Requires META_BUSINESS_ID env var.",
      {
        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 {
          let businessId: string;
          try {
            businessId = client.businessId;
          } catch {
            return { content: [{ type: "text" as const, text: "META_BUSINESS_ID environment variable is required for this operation. Please set it and restart the server." }], isError: true };
          }
          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(`/${businessId}/system_users`, 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 };
        }
      }
    );
  • Handler function for list_system_users. Extracts businessId from client, makes a GET request to /{businessId}/system_users with optional params, and returns JSON response with rate limit info.
    async ({ fields, limit, after }) => {
      try {
        let businessId: string;
        try {
          businessId = client.businessId;
        } catch {
          return { content: [{ type: "text" as const, text: "META_BUSINESS_ID environment variable is required for this operation. Please set it and restart the server." }], isError: true };
        }
        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(`/${businessId}/system_users`, 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 };
      }
    }
  • Zod schema defining input parameters: optional 'fields' (string), optional 'limit' (number, default 25), and optional 'after' (string for pagination).
    {
      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"),
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses the env var requirement, but does not state that the operation is read-only or describe other behavioral traits like pagination behavior (e.g., cursor usage). Minimal beyond env var.

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?

A single, front-loaded sentence that efficiently conveys purpose and a prerequisite. No unnecessary 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?

For a simple list tool with pagination, the description is adequate but does not explain return fields or clarify what 'system users' means vs other user types. Lacks explicit mention of defaults or response format.

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 has 100% description coverage for all three parameters (fields, limit, after). The description adds no additional meaning beyond the schema; baseline of 3 is appropriate.

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 tool lists system users for the configured business, specifying the exact resource and action. It distinguishes from sibling tools like 'list_business_users' by naming 'system users' explicitly.

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 mentions a prerequisite (META_BUSINESS_ID env var) but does not provide guidance on when to use this tool versus alternatives like 'list_business_users' or 'list_account_users'. The usage is implied but lacks explicit context.

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