get_meta() ); } /** * Determines whether ability metadata resolves to MCP exposure. * * @since 0.6.0 * * @param array $meta Ability metadata. * * @return bool True when the metadata resolves to MCP exposure, false otherwise. */ public static function is_meta_public( array $meta ): bool { $mcp_meta = $meta['mcp'] ?? array(); // Fail closed when `meta.mcp` is malformed. if ( ! is_array( $mcp_meta ) ) { return false; } if ( isset( $mcp_meta['public'] ) ) { return (bool) $mcp_meta['public']; } return true === ( $meta['public'] ?? false ); } }