Skip to main content
Glama

Get inventory metrics

get_inventory_metrics
Read-onlyIdempotent

Return counted Plainrouter arrivals beside daily Meta metrics for mirrored campaigns, ad sets and ads. object_metrics contains account-timezone daily comparisons; unmatched_arrivals is one workspace/window count without unknown IDs. Counts are null when the arrivals store is disabled. Optional change history shows who changed what, and whether it came through Plainrouter, within plan retention. basis_note explains how the two counts differ.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "account_id": "<account_id>"
    },
    "name": "get_inventory_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
ad_idNoLimit metrics to this ad ID.
limitNoMaximum rows per collection; byte budgets may return fewer.
cursorNoContinue all four collections using next_cursor with the same filters and include_changes.
adset_idNoLimit metrics to this ad set ID.
end_dateNoInclusive end date in YYYY-MM-DD format.
account_idYesAdvertising account ID available to the authorized workspace.
start_dateNoInclusive start date in YYYY-MM-DD format.
campaign_idNoLimit metrics to this campaign ID.
workspace_idNoWorkspace ID returned by list_workspaces. Required when this credential reaches multiple workspaces.
include_changesNoInclude object diffs and account activities: who changed what, and whether it came through Plainrouter.

Output Schema

NameRequiredDescriptionDefault
syncYes
accountYes
changesYes
metricsYes
stalenessYes
activitiesYes
basis_noteYes
paginationNo
next_cursorNo
object_metricsYes
effective_rangeYes
activity_historyYes
unmatched_arrivalsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / cursor / description
      Previous value: -"Continue all three collections using next_cursor with the same filters and include_changes."New value: +"Continue all four collections using next_cursor with the same filters and include_changes."
    • changedInput schema / properties / include_changes / description
      Previous value: -"Include object change history within the effective date window."New value: +"Include object diffs and account activities: who changed what, and whether it came through Plainrouter."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "account": {
      +      "type": "object"
      +    },
      +    "activities": {
      +      "items": {
      +        "properties": {
      +          "action_receipt_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "actor_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "application_name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "event_time": {
      +            "type": "string"
      +          },
      +          "event_type": {
      +            "type": "string"
      +          },
      +          "object": {
      +            "properties": {
      +              "external_id": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "name": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "type": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "type",
      +              "external_id",
      +              "name"
      +            ],
      +            "type": "object"
      +          },
      +          "receipt_missing": {
      +            "type": "boolean"
      +          },
      +          "source": {
      +            "enum": [
      +              "plainrouter",
      +              "meta",
      +              "outside_app",
      +              "ads_manager",
      +              "unknown"
      +            ],
      +            "type": "string"
      +          },
      +          "summary": {
      +            "properties": {
      +              "new_value": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "old_value": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "old_value",
      +              "new_value"
      +            ],
      +            "type": "object"
      +          },
      +          "translated_event_type": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "event_time",
      +          "object",
      +          "event_type",
      +          "translated_event_type",
      +          "source",
      +          "application_name",
      +          "actor_name",
      +          "action_receipt_id",
      +          "receipt_missing",
      +          "summary"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "activity_history": {
      +      "properties": {
      +        "gap_window": {
      +          "properties": {
      +            "from": {
      +              "type": "string"
      +            },
      +            "to": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "from",
      +            "to"
      +          ],
      +          "type": [
      +            "object",
      +            "null"
      +          ]
      +        },
      +        "last_error_code": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "last_error_code",
      +        "gap_window"
      +      ],
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "basis_note": {
      +      "type": "string"
      +    },
      +    "changes": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "effective_range": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "metrics": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "next_cursor": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "object_metrics": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "pagination": {
      +      "type": "object"
      +    },
      +    "staleness": {
      +      "type": "object"
      +    },
      +    "sync": {
      +      "type": "object"
      +    },
      +    "unmatched_arrivals": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "basis_note",
      +    "account",
      +    "sync",
      +    "staleness",
      +    "metrics",
      +    "changes",
      +    "activities",
      +    "activity_history",
      +    "effective_range",
      +    "object_metrics",
      +    "unmatched_arrivals"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already establish that this is a safe, idempotent read, so the bar is lower, but the description still adds real context: object_metrics are account-timezone daily comparisons, unmatched_arrivals is a single workspace/window count without unknown IDs, counts go null when the arrivals store is disabled, and change history is bounded by plan retention. These are non-obvious operating conditions an agent would not get from structured fields.

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

Conciseness4/5

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

The primary purpose leads the description and supporting details follow, with no filler sentences. Some phrasings are terse to the point of opacity ('one workspace/window count without unknown IDs'), but each sentence carries distinct information.

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

Completeness4/5

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

With an output schema present, the description need not enumerate return fields, and full schema coverage handles the ten parameters; the description covers the important behavioral caveats (disabled store, retention window, timezone basis). What remains missing is any routing guidance against the similar reporting siblings.

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 all ten parameters are already documented in the schema. The description only echoes include_changes ('who changed what, and whether it came through Plainrouter') and gestures at the collection set, adding marginal meaning beyond the schema. Baseline 3 is appropriate.

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

Purpose4/5

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

The description states a concrete verb and resource: return counted arrivals alongside daily Meta metrics for campaigns, ad sets, and ads. It is specific about what the payload contains (object_metrics, unmatched_arrivals). It does not, however, distinguish itself from adjacent siblings such as get_arrivals_comparison or get_performance, which an agent could easily confuse with this one.

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?

There is no explicit when-to-use guidance and no mention of alternatives or exclusions. The only conditional statements ('counts are null when the arrivals store is disabled', 'within plan retention') describe behavior, not tool selection. An agent must infer from the name alone when to reach for this versus other reporting tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources