gform_mcp_server_tools

Description

The gform_mcp_server_tools filter has the final say on which enabled tools the dedicated Gravity Forms MCP server lists to connected agents.

Usage

The following would apply to all abilities.

add_filter( 'gform_mcp_server_tools', 'your_function_name' );

Parameters

ParameterTypeDescription
$namesstring[]The names of the abilities to be listed as tools by the MCP server.

Examples

Never Expose Form Deletion Over MCP.

// Never expose form deletion over MCP, regardless of the settings screen.
add_filter( 'gform_mcp_server_tools', function ( $names ) {
	return array_diff( $names, array( 'gravityforms/forms-delete' ) );
} );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in gravityforms/includes/abilities/class-gf-abilities-service-provider.php

Since

The filter was added in Gravity Forms 3.1.0