AI Engine 3.9.4 has 10 actions and 128 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when AI Engine fires an action
add_action( 'litespeed_control_set_nocache', function( $arg1 ) {
// Your code runs here.
}, 10, 1 );
// Change a value AI Engine is about to use
add_filter( 'mwai_mcp_stream_max_time', function( $max_time, $session_id ) {
// Change $max_time here.
return $max_time;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
mwai_mcp_stream_max_time
filter/** * How long an idle SSE stream may hold a PHP worker, in seconds. */ apply_filters( 'mwai_mcp_stream_max_time', $max_time, $session_id ); -
mwai_ai_exception
filterapply_filters( 'mwai_ai_exception', 'Sorry, your query has been rejected.' ); -
mwai_mcp_tools
filterapply_filters( 'mwai_mcp_tools', [] ); -
mwai_anthropic_endpoint
filterapply_filters( 'mwai_anthropic_endpoint', 'https://api.anthropic.com/v1', $this->env ); -
mwai_openai_endpoint
filterapply_filters( 'mwai_openai_endpoint', 'https://api.openai.com/v1', $this->env ); -
mwai_chatbot_params
filterapply_filters( 'mwai_chatbot_params', $newParams ); -
mwai_files_delete
filterapply_filters( 'mwai_files_delete', $fileRefs ); -
mwai_functions_list
filterapply_filters( 'mwai_functions_list', [] ); -
mwai_mcp_self_test_sslverify
filterapply_filters( 'mwai_mcp_self_test_sslverify', true ); -
mwai_xai_endpoint
filterapply_filters( 'mwai_xai_endpoint', 'https://api.x.ai/v1', $this->env ); -
apply_filters( "{$this->prefix}_meowapps_is_registered", false, $this->prefix ); -
apply_filters( "{MWAI_PREFIX}_meowapps_is_registered", false, MWAI_PREFIX ); -
mwai_ai_mcp_servers
filterapply_filters( 'mwai_ai_mcp_servers', $resolved_servers, $query ); -
mwai_anthropic_models
filterapply_filters( 'mwai_anthropic_models', Meow_MWAI_Engines_Anthropic::get_models_static() ); -
mwai_chatbot_actions
filterapply_filters( 'mwai_chatbot_actions', $actions, $filterParams ); -
mwai_chatbot_blocks
filterapply_filters( 'mwai_chatbot_blocks', [], $filterParams ); -
mwai_chatbot_query
filterapply_filters( 'mwai_chatbot_query', $query, $params ); -
mwai_chatbot_reply
filterapply_filters( 'mwai_chatbot_reply', $takeoverAnswer, $reply, $params, [] ); -
mwai_chatbot_shortcuts
filterapply_filters( 'mwai_chatbot_shortcuts', [], $filterParams ); -
apply_filters( 'mwai_discussion_metadata_last_update', $this->core->format_discussion_date( $chat['updated'] ), $chat ); -
apply_filters( 'mwai_discussion_metadata_message_count', is_array( $messages ) ? count( $messages ) : 0, $chat ); -
apply_filters( 'mwai_discussion_metadata_start_date', $this->core->format_discussion_date( $chat['created'] ), $chat ); -
mwai_estimate_tokens
filterapply_filters( 'mwai_estimate_tokens', $tokenCount, $text ); -
mwai_google_endpoint
filterapply_filters( 'mwai_google_endpoint', 'https://generativelanguage.googleapis.com/v1beta', $this->env ); -
mwai_languages
filterapply_filters( 'mwai_languages', MWAI_LANGUAGES ); -
mwai_mcp_callback
filterapply_filters( 'mwai_mcp_callback', null, $name, $args, 0, null ); -
mwai_mistral_endpoint
filterapply_filters( 'mwai_mistral_endpoint', 'https://api.mistral.ai/v1', $this->env ); -
mwai_openai_body
filterapply_filters( 'mwai_openai_body', $body, $query ); -
mwai_openai_models
filterapply_filters( 'mwai_openai_models', Meow_MWAI_Engines_OpenAI::get_models_static() ); -
mwai_openrouter_endpoint
filterapply_filters( 'mwai_openrouter_endpoint', 'https://openrouter.ai/api/v1', $this->env ); -
mwai_perplexity_endpoint
filterapply_filters( 'mwai_perplexity_endpoint', 'https://api.perplexity.ai', $this->env ); -
mwai_perplexity_models
filterapply_filters( 'mwai_perplexity_models', Meow_MWAI_Engines_Perplexity::get_models_static() ); -
mwai_sakana_models
filterapply_filters( 'mwai_sakana_models', Meow_MWAI_Engines_Sakana::get_models_static() ); -
mwai_xai_models
filterapply_filters( 'mwai_xai_models', Meow_MWAI_Engines_XAI::get_models_static() ); -
the_content
filterapply_filters( 'the_content', $text ); -
apply_filters( "{$this->prefix}_meowapps_status", null ); -
apply_filters( "{$this->prefix}_meowapps_version_info", null ); -
https_local_ssl_verify
filterapply_filters( 'https_local_ssl_verify', false ); -
do_action( 'litespeed_control_set_nocache', 'Meow Apps API must not be cached.' ); -
litespeed_purge_all
actiondo_action( 'litespeed_purge_all' ); -
litespeed_purge_post
actiondo_action( 'litespeed_purge_post', $post_id ); -
litespeed_purge_url
actiondo_action( 'litespeed_purge_url', $url ); -
meowapps_plugins_status
filterapply_filters( 'meowapps_plugins_status', [] ); -
mwai_{$type}_enabled
filterapply_filters( "mwai_{$type}_enabled", defined( $constant ) && constant( $constant ) ); -
mwai_addons
filterapply_filters( 'mwai_addons', [ [ 'slug' => 'mwai-notifications', 'name' => 'Notifications', 'description' => 'Get real-time alerts for new discussions in your chatbot, so you never miss a chance to engage.', 'install_url' => 'https://meowapps.com/products/mwai-notifications/', 'settings_url' => null, 'stars' => 4, 'enabled' => false ], [ 'slug' => 'mwai-ollama', 'name' => 'Ollama', 'description' => 'Leverage local LLM inte... ); -
mwai_ai_allowed
filterapply_filters( 'mwai_ai_allowed', true, $query, $limits ); -
mwai_ai_context
filterapply_filters( 'mwai_ai_context', $instructions, $this ); -
mwai_ai_embeddings_query
filterapply_filters( 'mwai_ai_embeddings_query', $query ); -
mwai_ai_feedback
filterapply_filters( 'mwai_ai_feedback', null, $needFeedback, $reply ); -
mwai_ai_feedback_query
filterapply_filters( 'mwai_ai_feedback_query', $query ); -
mwai_ai_instructions
filterapply_filters( 'mwai_ai_instructions', $filtered, $this ); -
mwai_ai_query
filterapply_filters( 'mwai_ai_query', $query ); -
mwai_ai_reply
filterapply_filters( 'mwai_ai_reply', $reply, $query ); -
mwai_allow_mcp
filterapply_filters( 'mwai_allow_mcp', $is_admin, $request ); -
mwai_allow_public_api
filterapply_filters( 'mwai_allow_public_api', $logged_in, $feature, $extra ); -
mwai_allow_session
filterapply_filters( 'mwai_allow_session', false ); -
mwai_allow_setup
filterapply_filters( 'mwai_allow_setup', current_user_can( 'manage_options' ) ); -
mwai_allow_usage
filterapply_filters( 'mwai_allow_usage', $editor_or_admin ); -
mwai_anthropic_body
filterapply_filters( 'mwai_anthropic_body', $this->build_body( $query, $streamCallback ), $query ); -
mwai_blocked_rest_params
filterapply_filters( 'mwai_blocked_rest_params', $blocked, $params ); -
apply_filters( 'mwai_chatbot_allow_client_server_params', $this->core->can_access_settings(), $botId, $params ); -
mwai_chatbot_takeover
filterapply_filters( 'mwai_chatbot_takeover', null, $query, $params ); -
mwai_chatbot_texts
filterapply_filters( 'mwai_chatbot_texts', $texts ); -
mwai_context_framing
filterapply_filters( 'mwai_context_framing', $framing, $context ); -
mwai_context_search
filterapply_filters( 'mwai_context_search', [], $query, [ 'embeddingsEnvId' => $embeddingsEnvId, 'streamCallback' => $streamCallback ] ); -
mwai_custom_endpoint
filterapply_filters( 'mwai_custom_endpoint', $endpoint, $this->env ); -
apply_filters( 'mwai_discussion_format_messages', $html, $json, $format ); -
apply_filters( 'mwai_discussions_refresh_interval', $frontSystem['refreshInterval'] ); -
apply_filters( 'mwai_discussions_retention_days', (int) $retention_option ); -
apply_filters( 'mwai_discussions_title_prompt', $base_prompt, $conversation_text, $discussion ); -
mwai_embedding_max_tokens
filterapply_filters( 'mwai_embedding_max_tokens', 8192, $query->model ); -
mwai_engine_models
filterapply_filters( 'mwai_engine_models', [], $env, $query ); -
mwai_engines
filterapply_filters( 'mwai_engines', $engines ); -
mwai_estimate_tokens_text
filterapply_filters( 'mwai_estimate_tokens_text', $text, $model ); -
mwai_function_call_max_depth
filterapply_filters( 'mwai_function_call_max_depth', $maxDepth, $query ); -
mwai_function_call_params
filterapply_filters( 'mwai_function_call_params', $needFeedback['arguments'], $needFeedback, $reply ); -
apply_filters( 'mwai_google_interactions_body', $body, $query ); -
apply_filters( 'mwai_google_interactions_empty_reply', __( "Sorry, I couldn't produce a response for that. Please try rephrasing your request.", 'ai-engine' ), $query ); -
mwai_guest_uploads_per_hour
filterapply_filters( 'mwai_guest_uploads_per_hour', 20 ); -
mwai_init_engine
filterapply_filters( 'mwai_init_engine', null, $core, $env ); -
mwai_internal_chatbot
filterapply_filters( 'mwai_internal_chatbot', null, $botId, $params ); -
mwai_magic_wand_{$action}
filterapply_filters( "mwai_magic_wand_{$action}", '', $data ); -
mwai_mcp_abilities
filterapply_filters( 'mwai_mcp_abilities', $abilities ); -
mwai_mcp_instructions
filterapply_filters( 'mwai_mcp_instructions', implode( ' ', $parts ) ); -
mwai_mcp_mutate
actiondo_action( 'mwai_mcp_mutate', $tool, $a, $r ); -
mwai_mcp_needs_approval
filterapply_filters( 'mwai_mcp_needs_approval', $gated, $tool, $args ); -
apply_filters( 'mwai_mcp_oauth_user_can_authorize', $allowed, $user_id ); -
mwai_mcp_post_changed
actiondo_action( 'mwai_mcp_post_changed', $post_id, $context ); -
do_action( 'mwai_mcp_purge_discovery_urls', $urls ); -
mwai_mcp_seo_adapters
filterapply_filters( 'mwai_mcp_seo_adapters', $adapters ); -
mwai_mcp_tool_called
actiondo_action( 'mwai_mcp_tool_called', [ 'tool' => $tool, 'args' => $args, 'result' => $response, 'status' => $status, 'error_msg' => $error_msg, 'duration_ms' => $duration_ms, 'client_id' => $this->auth_client_id, 'client_name' => $this->auth_client_name, 'auth_method' => $this->auth_method, 'request_id' => $id, 'user_id' => get_current_user_id(), 'access_level' => $tool_level, 'writes' => $this->is_write_call( (string) $tool, $arg... ); -
mwai_mcp_undo_kinds
filterapply_filters( 'mwai_mcp_undo_kinds', self::core_kinds() ); -
mwai_mcp_undo_targets
filterapply_filters( 'mwai_mcp_undo_targets', $targets, $tool, $a ); -
mwai_meowapps_version_info
filterapply_filters( 'mwai_meowapps_version_info', null ); -
mwai_mistral_models
filterapply_filters( 'mwai_mistral_models', Meow_MWAI_Engines_Mistral::get_models_static() ); -
mwai_openrouter_body
filterapply_filters( 'mwai_openrouter_body', $body, $query ); -
mwai_openrouter_site_name
filterapply_filters( 'mwai_openrouter_site_name', self::APP_NAME, $query ); -
mwai_openrouter_site_url
filterapply_filters( 'mwai_openrouter_site_url', self::APP_URL, $query ); -
mwai_openrouter_web_plugin
filterapply_filters( 'mwai_openrouter_web_plugin', [ 'id' => 'web' ], $query ); -
mwai_ovh_endpoint
filterapply_filters( 'mwai_ovh_endpoint', trailingslashit( $this->endpoint ) . 'v1', $this->env ); -
mwai_placeholders
filterapply_filters( 'mwai_placeholders', $defaultPlaceholders ); -
mwai_post_content
filterapply_filters( 'mwai_post_content', $text, $postId ); -
mwai_pre_post_content
filterapply_filters( 'mwai_pre_post_content', $post->post_content, $postId ); -
mwai_prompt_correctText
filterapply_filters( 'mwai_prompt_correctText', "Correct the typos and grammar mistakes in this text without altering its content. Ensure the reply is in the same language as the original text.\n\n", $arguments ); -
mwai_prompt_enhanceText
filterapply_filters( 'mwai_prompt_enhanceText', "Enhance this text by improving readability and quality, using a more suitable vocabulary, and refining its structure.\n\n", $arguments ); -
mwai_prompt_generateImage
filterapply_filters( 'mwai_prompt_generateImage', "Generate an image that is relevant to the following text:\n\n", $arguments ); -
mwai_prompt_longerText
filterapply_filters( 'mwai_prompt_longerText', "Expand the subsequent text to a minimum of three times its original length, integrating relevant and accurate information to enrich its content. If the text is a story, amplify its charm by elaborating on essential aspects, enhancing readability, and creating a sense of engagement for the reader. Maintain consistency in tone and vocabulary throughout the expansion process.\n\n", $arguments ); -
mwai_prompt_shorterText
filterapply_filters( 'mwai_prompt_shorterText', "Condense the following text by reducing its length to half, while retaining the core elements of the original narrative. Focus on maintaining the essence of the story and its key details.\n\n", $arguments ); -
mwai_prompt_suggestExcerpts
filterapply_filters( 'mwai_prompt_suggestExcerpts', 'Craft a clear, SEO-optimized introduction for the following text, using 120 to 170 characters. Ensure the introduction is concise and relevant, without including any URLs.' . $this->keepLanguage( $language ), $arguments ); -
mwai_prompt_suggestSynonyms
filterapply_filters( 'mwai_prompt_suggestSynonyms', "Provide 5 synonyms or 5 ways of rephrasing the given word or sentence while retaining the original meaning and preserving the initial and final punctuation and spacing if any. Offer only the resulting word or expression, without additional context. If a suitable synonym or alternative cannot be identified, ensure that a creative response is still provided. Separate every suggestion with a new ... ); -
mwai_prompt_suggestTitles
filterapply_filters( 'mwai_prompt_suggestTitles', 'Generate a concise, SEO-optimized title for the following text, without using quotes or any other formatting. Focus on clarity and relevance to the content.' . $this->keepLanguage( $language ), $arguments ); -
mwai_prompt_translateSection
filterapply_filters( 'mwai_prompt_translateSection', $instructions, $arguments ); -
mwai_prompt_translateText
filterapply_filters( 'mwai_prompt_translateText', "Translate the text into {$language}, preserving the tone, mood, and nuance, while staying as true as possible to the original meaning. Provide only the translated text, without any additional content.", $arguments ); -
mwai_public_error_message
filterapply_filters( 'mwai_public_error_message', $message, $exception ); -
mwai_replicate_endpoint
filterapply_filters( 'mwai_replicate_endpoint', 'https://api.replicate.com/v1', $this->env ); -
mwai_reply_truncated_notice
filterapply_filters( 'mwai_reply_truncated_notice', $notice, $reply, $context ); -
mwai_request_timeout
filterapply_filters( 'mwai_request_timeout', 120, $query ); -
mwai_rest_authorized
filterapply_filters( 'mwai_rest_authorized', $rest_nonce, $request ); -
mwai_sakana_endpoint
filterapply_filters( 'mwai_sakana_endpoint', 'https://api.sakana.ai/v1', $this->env ); -
mwai_seo_stats
filterapply_filters( 'mwai_seo_stats', null ); -
mwai_stats_logs_activity
filterapply_filters( 'mwai_stats_logs_activity', [], $hours ); -
apply_filters( 'mwai_stats_logs_activity_daily', [], $days, $feature ); -
apply_filters( 'mwai_stats_logs_activity_daily_by_model', [], $days ); -
mwai_stats_logs_delete
filterapply_filters( 'mwai_stats_logs_delete', true, $logIds ); -
mwai_stats_logs_list
filterapply_filters( 'mwai_stats_logs_list', [], $offset, $limit, $filters, $sort ); -
mwai_stats_logs_meta
filterapply_filters( 'mwai_stats_logs_meta', [], $logId, $metaKeys ); -
apply_filters( 'mwai_stream_keepalive_interval', 15 ); -
mwai_stream_push
filterapply_filters( 'mwai_stream_push', $data, $query ); -
mwai_task_{$task->task_name}
filterapply_filters( "mwai_task_{$task->task_name}", null, $job ); -
mwai_task_run
filterapply_filters( 'mwai_task_run', null, $job ); -
mwai_tasks_run
actiondo_action( 'mwai_tasks_run' ); -
mwai_trusted_proxies
filterapply_filters( 'mwai_trusted_proxies', self::CLOUDFLARE_RANGES ); -
mwai_uploads_offered
filterapply_filters( 'mwai_uploads_offered', $offered ); -
apply_filters( 'mwai_visitor_upload_extensions', $extensions ); -
apply_filters( 'mwai_workspace_self_test_sslverify', true ); -
robots_txt
filterapply_filters( 'robots_txt', $default, $public ); -
wpfc_clear_all_cache
actiondo_action( 'wpfc_clear_all_cache' ); -
wpml_post_language_details
filterapply_filters( 'wpml_post_language_details', null, $postId );
Generated from AI Engine's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: