Skip to main content
Glama

meta_subscribe_webhook

Subscribe to real-time webhook notifications for Meta platform objects like Instagram pages or users. Configure HTTPS endpoints to receive updates on messages, feed changes, and other specified fields.

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 `meta_subscribe_webhook` tool is registered and implemented within `src/tools/meta/auth.ts` using the `server.tool` method. It takes an object, callback_url, verify_token, and fields as arguments and calls the Meta API's `/app/subscriptions` endpoint via the provided `client`.
    // ─── meta_subscribe_webhook ──────────────────────────────────
    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 };
        }
      }
    );

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