REST Resource: projects.locations.apis.versions.operations

Resource: ApiOperation

Represents an operation contained in an API version in the API Hub. An operation is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, an operation will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Alternatively operations can be managed via create,update and delete APIs, creation of apiOperation can be possible only for version with no parsed operations and update/delete can be possible only for operations created via create API.

JSON representation
{
  "name": string,
  "spec": string,
  "details": {
    object (OperationDetails)
  },
  "createTime": string,
  "updateTime": string,
  "attributes": {
    string: {
      object (AttributeValues)
    },
    ...
  },
  "sourceMetadata": [
    {
      object (SourceMetadata)
    }
  ]
}
Fields
name

string

Identifier. The name of the operation.

Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}

spec

string

Output only. The name of the spec will be of the format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec} Note:The name of the spec will be empty if the operation is created via operations.create API.

details

object (OperationDetails)

Optional. Operation details. Note: Even though this field is optional, it is required for operations.create API and we will fail the request if not provided.

createTime

string (Timestamp format)

Output only. The time at which the operation was created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The time at which the operation was last updated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

attributes

map (key: string, value: object (AttributeValues))

Optional. The list of user defined attributes associated with the API operation resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

sourceMetadata[]

object (SourceMetadata)

Output only. The list of sources and metadata from the sources of the API operation.

OperationDetails

The operation details parsed from the spec.

JSON representation
{
  "description": string,
  "documentation": {
    object (Documentation)
  },
  "deprecated": boolean,

  // Union field operation can be only one of the following:
  "httpOperation": {
    object (HttpOperation)
  },
  "mcpTool": {
    object (McpTool)
  }
  // End of list of possible types for union field operation.
}
Fields
description

string

Optional. Description of the operation behavior. For OpenAPI spec, this will map to operation.description in the spec, in case description is empty, operation.summary will be used.

documentation

object (Documentation)

Optional. Additional external documentation for this operation. For OpenAPI spec, this will map to operation.documentation in the spec.

deprecated

boolean

Optional. For OpenAPI spec, this will be set if operation.deprecatedis marked as true in the spec.

Union field operation.

operation can be only one of the following:

httpOperation

object (HttpOperation)

The HTTP Operation.

mcpTool

object (McpTool)

The MCP Tool Operation.

McpTool

Details describing an MCP Tool.

JSON representation
{
  "name": string,
  "title": string,
  "description": string,
  "annotations": {
    object (ToolAnnotations)
  },
  "inputSchema": {
    object (OperationSchema)
  },
  "outputSchema": {
    object (OperationSchema)
  }
}
Fields
name

string

Required. The name of the tool, unique within its parent scope (version).

title

string

Optional. Optional title for the tool.

description

string

Optional. Description of what the tool does.

annotations

object (ToolAnnotations)

Optional. Optional annotations for the tool.

inputSchema

object (OperationSchema)

Optional. Input schema for the operation. This can be parsed only from MCP schema type.

outputSchema

object (OperationSchema)

Optional. Output schema for the operation. This can be parsed only from MCP schema type.

ToolAnnotations

Annotations for a Tool.

JSON representation
{
  "title": string,
  "additionalHints": {
    string: string,
    ...
  },
  "readOnlyHint": boolean,
  "destructiveHint": boolean,
  "idempotentHint": boolean,
  "openWorldHint": boolean
}
Fields
title

string

Optional. A human-readable title for the tool (if different from Tool.title).

additionalHints

map (key: string, value: string)

Optional. Additional hints which may help tools and not covered in defaults.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

readOnlyHint

boolean

Optional. Hint indicating if the tool is read-only.

destructiveHint

boolean

Optional. Hint indicating if the tool may have destructive side effects.

idempotentHint

boolean

Optional. Hint indicating if the tool is idempotent.

openWorldHint

boolean

Optional. Hint indicating if the tool interacts with the open world (e.g., internet).

OperationSchema

The operation schema needed for an operation.

JSON representation
{

  // Union field value can be only one of the following:
  "jsonSchema": {
    object
  }
  // End of list of possible types for union field value.
}
Fields
Union field value. The value of the schema. value can be only one of the following:
jsonSchema

object (Struct format)

The JSON schema. Only valid JSON is accepted but semantic validation of schema is not supported right now.

Methods

create

Create an apiOperation in an API version.

delete

Delete an operation in an API version and we can delete only the operations created via create API.

get

Get details about a particular operation in API version.

list

List operations in an API version.

patch

Update an operation in an API version.