// 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.agentregistry.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/agentregistry/v1/properties.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.AgentRegistry.V1";
option go_package = "cloud.google.com/go/agentregistry/apiv1/agentregistrypb;agentregistrypb";
option java_multiple_files = true;
option java_outer_classname = "McpServerProto";
option java_package = "com.google.cloud.agentregistry.v1";
option php_namespace = "Google\\Cloud\\AgentRegistry\\V1";
option ruby_package = "Google::Cloud::AgentRegistry::V1";

// Represents an MCP (Model Context Protocol) Server.
message McpServer {
  option (google.api.resource) = {
    type: "agentregistry.googleapis.com/McpServer"
    pattern: "projects/{project}/locations/{location}/mcpServers/{mcp_server}"
    plural: "mcpServers"
    singular: "mcpServer"
  };

  // Represents a single tool provided by an MCP Server.
  message Tool {
    // Annotations describing the characteristics and behavior of a tool or
    // operation.
    message Annotations {
      // Output only. A human-readable title for the tool.
      string title = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

      // Output only. If true, the tool may perform destructive updates to its
      // environment. If false, the tool performs only additive updates. NOTE:
      // This property is meaningful only when `read_only_hint == false`
      // Default: true
      bool destructive_hint = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

      // Output only. If true, calling the tool repeatedly with the same
      // arguments will have no additional effect on its environment. NOTE: This
      // property is meaningful only when `read_only_hint == false` Default:
      // false
      bool idempotent_hint = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

      // Output only. If true, this tool may interact with an "open world" of
      // external entities. If false, the tool's domain of interaction is
      // closed. For example, the world of a web search tool is open, whereas
      // that of a memory tool is not. Default: true
      bool open_world_hint = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

      // Output only. If true, the tool does not modify its environment.
      // Default: false
      bool read_only_hint = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
    }

    // Output only. Human-readable name of the tool.
    string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Description of what the tool does.
    string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. Annotations associated with the tool.
    Annotations annotations = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  }

  // Identifier. The resource name of the MCP Server.
  // Format: `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. A stable, globally unique identifier for MCP Servers.
  string mcp_server_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The display name of the MCP Server.
  string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The description of the MCP Server.
  string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The connection details for the MCP Server.
  repeated Interface interfaces = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Tools provided by the MCP Server.
  repeated Tool tools = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Create time.
  google.protobuf.Timestamp create_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Update time.
  google.protobuf.Timestamp update_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Attributes of the MCP Server.
  // Valid values:
  //
  //  * `agentregistry.googleapis.com/system/RuntimeIdentity`: {"principal":
  //  "principal://..."} - the runtime identity associated with the MCP Server.
  //  * `agentregistry.googleapis.com/system/RuntimeReference`: {"uri": "//..."}
  //  - the URI of the underlying resource hosting the MCP Server, for
  //  example, the GKE Deployment.
  map<string, google.protobuf.Struct> attributes = 8
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
