Skip to main content
Glama

get_account_activities

Retrieve activity logs for an ad account to track changes made to campaigns, ad sets, and ads.

Instructions

Get activity log for the ad account. Shows changes made to campaigns, ad sets, ads, etc.

Input Schema

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

Implementation Reference

  • The tool registration and handler for 'get_account_activities'. It defines the schema (fields, limit, after), builds query params, and calls client.get to fetch activity log from the ad account.
    server.tool(
      "get_account_activities",
      "Get activity log for the ad account. Shows changes made to campaigns, ad sets, ads, etc.",
      {
        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}/activities`, 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 };
        }
      }
    );
  • Input schema for the tool: optional 'fields' (string), optional 'limit' (number, default 25), optional 'after' (pagination cursor string).
    {
      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/index.ts:89-90 (registration)
    Registration call: registerAccountTools(server, client) wires up all account tools including get_account_activities.
    registerAccountTools(server, client);
    registerBusinessTools(server, client);
  • Export signature of registerAccountTools which registers all account-related tools on the server.
    export function registerAccountTools(server: McpServer, client: AdsClient): void {
Behavior2/5

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

With no annotations, the description bears full burden. It states the tool 'shows changes' but does not disclose if it is read-only, any side effects, or how pagination works beyond the schema's 'after' parameter. Minimal behavioral context.

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?

Two sentences: first states purpose, second gives examples. No filler, efficiently front-loaded with essential information.

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?

Tool has 3 parameters, no output schema, and no annotations. The description omits details like date range, ordering, or return format. It is minimally adequate but leaves gaps for an agent expecting comprehensive guidance.

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?

The input schema covers 100% of parameters (fields, limit, after) with descriptions. The tool description adds no extra meaning beyond what the schema already provides, so baseline score of 3 applies.

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 verb 'Get' and the resource 'activity log for the ad account', with examples of changes shown. This is distinct from sibling tools like 'get_ad_account' or 'get_account_insights', so purpose is unambiguous.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool vs alternatives (e.g., get_account_insights, list_ads). There are no notes on prerequisites, filtering, or exclusions, leaving the agent to infer usage 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