Skip to main content
Glama

meta_subscribe_webhook

Subscribe to webhook notifications for Meta objects like Instagram or Page. Provide callback URL, verify token, and fields to receive updates on changes such as messages or feed.

Instructions

Subscribe to webhook notifications for an object (e.g., 'instagram', 'page'). Requires META_APP_ID and META_APP_SECRET.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectYesObject type to subscribe to
callback_urlYesHTTPS webhook endpoint URL
verify_tokenYesVerification token for the webhook
fieldsYesComma-separated list of fields to subscribe (e.g., 'messages,feed')

Implementation Reference

  • The handler for the meta_subscribe_webhook tool. It accepts object, callback_url, verify_token, and fields parameters, then calls client.meta('POST', '/app/subscriptions') to subscribe to webhook notifications for a Meta App.
    server.tool(
      "meta_subscribe_webhook",
      "Subscribe to webhook notifications for an object (e.g., 'instagram', 'page'). Requires META_APP_ID and META_APP_SECRET.",
      {
        object: z.enum(["instagram", "page", "user", "permissions"]).describe("Object type to subscribe to"),
        callback_url: z.string().url().describe("HTTPS webhook endpoint URL"),
        verify_token: z.string().describe("Verification token for the webhook"),
        fields: z.string().describe("Comma-separated list of fields to subscribe (e.g., 'messages,feed')"),
      },
      async ({ object, callback_url, verify_token, fields }) => {
        try {
          const { data, rateLimit } = await client.meta("POST", `/app/subscriptions`, {
            object,
            callback_url,
            verify_token,
            fields,
          });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Webhook subscribe failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Zod input schema for meta_subscribe_webhook: object (enum), callback_url (URL), verify_token (string), fields (string).
    {
      object: z.enum(["instagram", "page", "user", "permissions"]).describe("Object type to subscribe to"),
      callback_url: z.string().url().describe("HTTPS webhook endpoint URL"),
      verify_token: z.string().describe("Verification token for the webhook"),
      fields: z.string().describe("Comma-separated list of fields to subscribe (e.g., 'messages,feed')"),
    },
  • The tool is registered on the McpServer via server.tool() inside the registerMetaAuthTools function, which is called from src/index.ts.
    server.tool(
      "meta_subscribe_webhook",
      "Subscribe to webhook notifications for an object (e.g., 'instagram', 'page'). Requires META_APP_ID and META_APP_SECRET.",
      {
        object: z.enum(["instagram", "page", "user", "permissions"]).describe("Object type to subscribe to"),
        callback_url: z.string().url().describe("HTTPS webhook endpoint URL"),
        verify_token: z.string().describe("Verification token for the webhook"),
        fields: z.string().describe("Comma-separated list of fields to subscribe (e.g., 'messages,feed')"),
      },
      async ({ object, callback_url, verify_token, fields }) => {
        try {
          const { data, rateLimit } = await client.meta("POST", `/app/subscriptions`, {
            object,
            callback_url,
            verify_token,
            fields,
          });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Webhook subscribe failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • The MetaClient.meta() method is the helper that makes the actual API call to the Meta Graph API using an app access token (appId|appSecret).
    async meta(
      method: string,
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      if (!this.config.appId || !this.config.appSecret) {
        throw new Error("META_APP_ID and META_APP_SECRET are required.");
      }
      const appToken = `${this.config.appId}|${this.config.appSecret}`;
      return this.request(IG_BASE, appToken, method, path, params);
    }
Behavior3/5

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

The description indicates a mutating operation but lacks details on side effects (e.g., behavior if already subscribed, rate limits, or error conditions). Since no annotations are provided, the description carries full burden but only partially fulfills it.

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, front-loaded with the main verb and resource. No redundant information, every word contributes to clarity.

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?

For a subscription creation tool with 4 required parameters and no output schema, the description covers the core action and prerequisites. Missing details on expected response or post-conditions, but sufficient for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for each parameter. The description adds value by noting external prerequisites (META_APP_ID, META_APP_SECRET) that are not in the schema, but does not elaborate on parameter usage beyond the schema.

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 action ('Subscribe to webhook notifications') and the resource ('an object (e.g., 'instagram', 'page')'), providing concrete examples. This distinguishes it from sibling tools like 'meta_get_webhook_subscriptions' which is for reading subscriptions.

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?

It explicitly mentions the requirement of META_APP_ID and META_APP_SECRET, which is a clear prerequisite. However, it does not specify when not to use this tool or mention alternatives beyond implying the existence of a get subscriptions tool.

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-mcp'

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