Skip to main content
Glama
InputSchema.php909 B
<?php // phpcs:ignore namespace Automattic\WordpressMcp\Utils; /** * Clean the input schema. * * @param array $input_schema The input schema. * @return array The cleaned input schema. */ class InputSchema { /** * Clean the input schema. * * @param array $input_schema The input schema. * @return array The cleaned input schema. */ public static function clean( $input_schema ) { if ( ! is_array( $input_schema ) ) { return $input_schema; } // Handle properties if they exist. if ( isset( $input_schema['properties'] ) ) { foreach ( $input_schema['properties'] as $property_name => $property ) { if ( isset( $property['type'] ) ) { // If type is an array, take the first element. if ( is_array( $property['type'] ) ) { $input_schema['properties'][ $property_name ]['type'] = reset( $property['type'] ); } } } } return $input_schema; } }

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/Automattic/wordpress-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server