// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.ces.v1;

import "google/api/field_behavior.proto";
import "google/cloud/ces/v1/auth.proto";
import "google/cloud/ces/v1/common.proto";
import "google/cloud/ces/v1/schema.proto";

option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb";
option java_multiple_files = true;
option java_outer_classname = "McpToolProto";
option java_package = "com.google.cloud.ces.v1";

// An MCP tool.
// See https://modelcontextprotocol.io/specification/2025-06-18/server/tools for
// more details.
message McpTool {
  // Required. The name of the MCP tool.
  string name = 1 [(google.api.field_behavior) = REQUIRED];

  // Optional. The description of the MCP tool.
  string description = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The schema of the input arguments of the MCP tool.
  Schema input_schema = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The schema of the output arguments of the MCP tool.
  Schema output_schema = 4 [(google.api.field_behavior) = OPTIONAL];

  // Required. The server address of the MCP server, e.g.,
  // "https://example.com/mcp/". If the server is built with the MCP SDK, the
  // url should be suffixed with
  // "/mcp/". Only Streamable HTTP transport based servers are supported. This
  // is the same as the server_address in the McpToolset. See
  // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http
  // for more details.
  string server_address = 5 [(google.api.field_behavior) = REQUIRED];

  // Optional. Authentication information required to execute the tool against
  // the MCP server. For bearer token authentication, the token applies only to
  // tool execution, not to listing tools. This requires that tools can be
  // listed without authentication.
  ApiAuthentication api_authentication = 6
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The TLS configuration. Includes the custom server certificates
  // that the client should trust.
  TlsConfig tls_config = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Service Directory configuration for VPC-SC, used to resolve
  // service names within a perimeter.
  ServiceDirectoryConfig service_directory_config = 8
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The custom headers to send in the request to the MCP server. The
  // values must be in the format `$context.variables.<name_of_variable>` and
  // can be set in the session variables. See
  // https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/open-api#openapi-injection
  // for more details.
  map<string, string> custom_headers = 9
      [(google.api.field_behavior) = OPTIONAL];
}
