Skip to content

Customize Tool Argument Validation ​

Easy MCP AI checks tool arguments before running a tool or requesting approval. These checks are targeted, not blanket enforcement of every JSON Schema rule: compatible conversions remain supported, and type and allowed-value checks also consider the requirements of the receiving tool or REST parameter.

Boolean arguments ​

Prefer JSON true and false. When a tool schema (the declared rules for its arguments) defines an argument with exactly type: boolean, Easy MCP AI also converts the nonblank strings true, false, 1, 0, yes, no, on, and off. Matching ignores case and surrounding spaces, so no and off mean false.

These rules apply to tool arguments, not deployment-configuration booleans. See wp-config.php Constants for the separate configuration rules.

Narrow compatibility exceptions ​

The easy_mcp_ai_refuse_off_schema_argument filter lets you exempt a specific validation finding from refusal. Its callback receives four arguments:

ArgumentMeaning
$refuseWhether this finding should cause refusal; initially true
$tool_nameThe MCP tool name
$argument_nameThe argument being checked
$kindThe refusal kind: boolean, type, or enum

Register the callback with accepted_args set to 4. Return the incoming $refuse for cases you do not explicitly exempt. Only returning the boolean value false excludes that finding from refusal; another finding can still cause the call to be refused.

Prefer correcting the input or schema. Use an exception only for a tested compatibility case scoped to an exact tool and argument. It does not change the argument value or bypass the receiving tool's checks, REST validation, disabled-tool restrictions, connection permissions, or approval requirements.

Was this helpful?