Skip to main content
Glama

get_account_insights

Retrieve Instagram business account analytics including reach, profile views, website clicks, and engagement metrics for performance tracking.

Instructions

Get account-level insights and analytics for Instagram business account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idNoInstagram business account ID (optional)
metricsNoSpecific metrics to retrieve
periodNoTime period for insightsday

Implementation Reference

  • The implementation of the getAccountInsights method which fetches insights from the Instagram Graph API.
    async getAccountInsights(
      metrics?: string[],
      period = "day",
      accountId?: string
    ): Promise<IGInsight[]> {
      const id = accountId ?? this.aid();
      const defaultMetrics = ["reach", "profile_views", "website_clicks"];
      const data = await this.request("GET", `${id}/insights`, {
        params: {
          metric: (metrics ?? defaultMetrics).join(","),
          period,
          metric_type: "total_value",
        },
      });
      return data.data ?? [];
  • src/index.ts:154-168 (registration)
    The registration of the get_account_insights tool, including its description and input schema.
    {
      name: "get_account_insights",
      description:
        "Get account-level insights and analytics for Instagram business account",
      inputSchema: {
        type: "object" as const,
        properties: {
          account_id: { type: "string", description: "Instagram business account ID (optional)" },
          metrics: {
            type: "array",
            items: { type: "string", enum: ["reach", "profile_views", "website_clicks", "accounts_engaged"] },
            description: "Specific metrics to retrieve",
          },
          period: { type: "string", enum: ["day", "lifetime"], description: "Time period for insights", default: "day" },
        },
  • The tool handler switch-case block that invokes the client's getAccountInsights method.
    case "get_account_insights": {
      const insights = await c.getAccountInsights(
        args.metrics,
        args.period ?? "day",
        args.account_id
      );

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/mcpware/instagram-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server