Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

7.7 KB
Raw Blame
# MCP tool definitions. Tools are opt-in: an operation is exposed only when it has an entry here.
# List operations without an entry: pnpm --filter=@posthog/mcp run scaffold-yaml -- --candidates --product messaging
# Add one: pnpm --filter=@posthog/mcp run scaffold-yaml -- --add <operationId> --product messaging
# To keep an operation off on purpose, set enabled: false and give a disabled_reason.
category: Messaging
feature: messaging
url_prefix: /workflows
ui_apps: {}
tools:
    message-categories-create:
        operation: messaging_categories_create
        enabled: true
        scopes:
            - hog_flow:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: false
        title: Create a message category
        description: >
            Create a message category, the topic a workflow message belongs to, such as a newsletter or product updates.
            Recipients can opt out of a marketing category, and sends skip the recipients who did. Use a transactional
            category for messages a recipient must get, such as receipts or password resets: those sends ignore
            opt-outs. Pass the returned id as message_category_id on a workflow email step, and set the step's
            message_category_type to the same category_type. The opt-out of messages step takes the id as its
            category_id input. Call message-categories-list first: the key must be unique in the project and can't
            change after creation.
        exclude_params:
            - deleted
    message-categories-get:
        operation: messaging_categories_retrieve
        enabled: true
        scopes:
            - hog_flow:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Get a message category
        description: >
            Get a message category by ID, with its key, name, descriptions, and category_type (marketing categories can
            be opted out of, transactional categories ignore opt-outs).
    message-categories-list:
        operation: messaging_categories_list
        enabled: true
        scopes:
            - hog_flow:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List message categories
        description: >
            List the project's message categories. Recipients can opt out of a marketing category, and transactional
            categories ignore opt-outs. Use a category's id as message_category_id on a workflow email step or as the
            category_id input of the opt-out of messages step, and its key as category_key in the opt-outs tools.
    message-categories-update:
        operation: messaging_categories_partial_update
        enabled: true
        scopes:
            - hog_flow:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: true
        title: Update a message category
        description: >
            Change a message category's name, description, public_description, or category_type. Only the fields you
            pass change, and the key can't change. Workflow steps keep the message_category_type they were saved with,
            so after a category_type change, update the message_category_type of the steps that use this category. A
            transactional send ignores opt-outs, so confirm a change to transactional with the user first.
        exclude_params:
            - key
            - deleted
    opt-outs-add:
        operation: messaging_preferences_bulk_add_opt_outs_create
        enabled: true
        scopes:
            - hog_flow:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Add recipients to the opt-out list
        description: >
            Opt one or more recipients (up to 1000 per call) out of marketing messages. Each entry can name its own
            message category via category_key; entries without one use the request-level category_key, or all marketing
            messages if omitted. Importing only ever opts recipients out, so repeating a call is safe.
    opt-outs-list:
        operation: messaging_preferences_opt_outs_retrieve
        enabled: true
        scopes:
            - hog_flow:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: List opt-outs
        description: >
            List recipients opted out of a message category, most recently updated first. Omit category_key to list
            recipients opted out of all marketing messages.
    opt-outs-remove:
        operation: messaging_preferences_remove_opt_out_create
        enabled: true
        scopes:
            - hog_flow:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Remove a recipient from the opt-out list
        description: >
            Opt a recipient back in to the message category named by category_key, or to all marketing messages if
            omitted. Use to honor a resubscribe recorded in your own app. Repeating a call is safe.
    supabase-auth-emails-settings-get:
        operation: messaging_supabase_auth_emails_settings_retrieve
        enabled: true
        scopes:
            - hog_flow:read
        title: Get the Supabase auth email settings
        description: >
            Get how the project sends a Supabase project's auth emails through PostHog email templates, including the
            hook URL to paste into Supabase and every email type it can map. Call this before
            supabase-auth-emails-settings-update, because that tool replaces the whole template mapping.
        feature_flag: workflows-supabase-auth-emails
    supabase-auth-emails-settings-update:
        operation: messaging_supabase_auth_emails_settings_partial_update
        enabled: true
        scopes:
            - hog_flow:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Update the Supabase auth email settings
        description: >
            Update how the project sends a Supabase project's auth emails. Send only the fields to change, but templates
            replaces the whole mapping, so include every type to keep. To get templates to map, call
            supabase-auth-emails-starter-templates-create or use the email template tools. Ask the user for the hook
            secret. Never invent one. Map the core emails before the user turns on the hook in Supabase. Load the
            setting-up-supabase-auth-emails skill before you set up or change the connection.
        feature_flag: workflows-supabase-auth-emails
        response:
            exclude:
                - email_types
                - hook_url
    supabase-auth-emails-starter-templates-create:
        operation: messaging_supabase_auth_emails_starter_templates_create
        enabled: true
        scopes:
            - hog_flow:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: false
        title: Create starter templates for the Supabase auth emails
        description: >
            Create and map an email template for each core Supabase auth email that has no usable template yet. A repeat
            call skips types that still have one. Needs a verified email sender on the project. Edit the templates
            afterwards with the email template tools. Load the setting-up-supabase-auth-emails skill before you set up
            the connection.
        feature_flag: workflows-supabase-auth-emails
        response:
            exclude:
                - email_types
                - hook_url