'comments/get-comment', 'args' => array( 'label' => __( 'Get Comment', 'acrossai-abilities-manager' ), 'description' => __( 'Fetch a comment via GET /wp/v2/comments/{id}.', 'acrossai-abilities-manager' ), 'category' => 'acrossai-comments', 'execute_callback' => array( $this, 'execute' ), 'permission_callback' => static function (): bool { return current_user_can( 'manage_options' ); }, 'input_schema' => array( 'type' => 'object', 'properties' => array( 'id' => array( 'type' => 'integer', 'minimum' => 1, ), ), 'required' => array( 'id' ), 'additionalProperties' => false, ), 'output_schema' => array( 'type' => 'object', 'properties' => array( 'success' => array( 'type' => 'boolean' ), 'comment' => array( 'type' => 'object' ), 'message' => array( 'type' => 'string' ), ), 'required' => array( 'success' ), 'additionalProperties' => false, ), 'meta' => array( 'acrossai' => array( 'tab_group' => 'content', 'sub_group' => 'manage', 'sub_group_label' => __( 'Manage', 'acrossai-abilities-manager' ), ), 'show_in_rest' => true, 'mcp' => array( 'public' => false, 'type' => 'tool', ), 'annotations' => array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ), ), ), ); } /** * Execute the ability. * * @param array $input Ability input payload. * @return array */ public function execute( array $input = array() ): array { $id = (int) ( $input['id'] ?? 0 ); if ( $id <= 0 ) { return array( 'success' => false, 'message' => __( 'A valid id is required.', 'acrossai-abilities-manager' ), ); } $comment = get_comment( $id ); if ( null === $comment ) { return array( 'success' => false, 'message' => __( 'Comment not found.', 'acrossai-abilities-manager' ), ); } return array( 'success' => true, 'comment' => Comment_Formatter::to_array( $comment ), ); } }