- NAME
-
- gcloud alpha apihub apis versions operations create - create apiOperations
- SYNOPSIS
-
-
gcloud alpha apihub apis versions operations create(OPERATION:--api=API--location=LOCATION--version=VERSION) [--attributes=[ATTRIBUTES,…]] [--details-deprecated--details-description=DETAILS_DESCRIPTION--documentation-external-uri=DOCUMENTATION_EXTERNAL_URI--http-operation-method=HTTP_OPERATION_METHOD--http-operation-path=HTTP_OPERATION_PATH--http-operation-path-description=HTTP_OPERATION_PATH_DESCRIPTION| [--mcp-tool-name=MCP_TOOL_NAME:--mcp-tool-description=MCP_TOOL_DESCRIPTION--mcp-tool-input-schema-json=MCP_TOOL_INPUT_SCHEMA_JSON--mcp-tool-output-schema-json=MCP_TOOL_OUTPUT_SCHEMA_JSON--mcp-tool-title=MCP_TOOL_TITLE--mcp-tool-annotations-additional-hints=[MCP_TOOL_ANNOTATIONS_ADDITIONAL_HINTS,…]--mcp-tool-annotations-destructive-hint--mcp-tool-annotations-idempotent-hint--mcp-tool-annotations-open-world-hint--mcp-tool-annotations-read-only-hint--mcp-tool-annotations-title=MCP_TOOL_ANNOTATIONS_TITLE]] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)Create an apiOperation - EXAMPLES
-
To create the apiOperation, run:
gcloud alpha apihub apis versions operations create - POSITIONAL ARGUMENTS
-
-
Operation resource - Identifier. The name of the operation.
Format:
projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}The arguments in this group can be used to specify the attributes of this resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways.To set the
projectattribute:-
provide the argument
operationon the command line with a fully specified name; -
provide the argument
--projecton the command line; -
set the property
core/project.
This must be specified.
OPERATION-
ID of the operation or fully qualified identifier for the operation.
To set the
operationattribute:-
provide the argument
operationon the command line.
This positional argument must be specified if any of the other arguments in this group are specified.
-
provide the argument
--api=API-
The api id of the operation resource.
To set the
apiattribute:-
provide the argument
operationon the command line with a fully specified name; -
provide the argument
--apion the command line.
-
provide the argument
--location=LOCATION-
The location id of the operation resource.
To set the
locationattribute:-
provide the argument
operationon the command line with a fully specified name; -
provide the argument
--locationon the command line.
-
provide the argument
--version=VERSION-
The version id of the operation resource.
To set the
versionattribute:-
provide the argument
operationon the command line with a fully specified name; -
provide the argument
--versionon the command line.
-
provide the argument
-
provide the argument
-
Operation resource - Identifier. The name of the operation.
- FLAGS
-
--attributes=[ATTRIBUTES,…]-
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.KEY-
Sets
KEYvalue. VALUE-
Sets
VALUEvalue.enumValues-
The attribute values associated with a resource in case attribute data type is
enum.
values-
The attribute values in case attribute data type is enum.
description- The detailed description of the allowed value.
displayName- The display name of the allowed value.
id-
The ID of the allowed value.
- If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource.
- If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutable- When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
jsonValues-
The attribute values associated with a resource in case attribute data type is
JSON.
values- The attribute values in case attribute data type is string or JSON.
stringValues-
The attribute values associated with a resource in case attribute data type is
string.
values- The attribute values in case attribute data type is string or JSON.
uriValues-
The attribute values associated with a resource in case attribute data type is
URL, URI or IP, like gs://bucket-name/object-name.
values- The attribute values in case attribute data type is string or JSON.
Shorthand Example:--attributes=string={enumValues={values=[{description=string,displayName=string,id=string,immutable=boolean}]},jsonValues={values=[string]},stringValues={values=[string]},uriValues={values=[string]}}
JSON Example:--attributes='{"string": {"enumValues": {"values": [{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]}, "jsonValues": {"values": ["string"]}, "stringValues": {"values": ["string"]}, "uriValues": {"values": ["string"]}}}'
File Example:--attributes=path_to_file.(yaml|json)
- The operation details parsed from the spec.
--details-deprecated-
For OpenAPI spec, this will be set if
operation.deprecated`is marked astruein the spec. --details-description=DETAILS_DESCRIPTION-
Description of the operation behavior. For OpenAPI spec, this will map to
operation.description
in the spec, in case description is empty,operation.summarywill be used. - Documentation details.
--documentation-external-uri=DOCUMENTATION_EXTERNAL_URI- The uri of the externally hosted documentation.
-
Arguments for the operation.
At most one of these can be specified:
- The HTTP Operation.
--http-operation-method=HTTP_OPERATION_METHOD-
Operation method Note: Even though this field is optional, it is required for
[CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API and
we will fail the request if not provided.
HTTP_OPERATION_METHODmust be one of:delete- Delete Operation type.
get- Get Operation type.
head- Head Operation type.
options- Options Operation type.
patch- Patch Operation type.
post- Post Operation type.
put- Put Operation type.
trace- Trace Operation type.
- The path details derived from the spec.
--http-operation-path=HTTP_OPERATION_PATH- Complete path relative to server endpoint. Note: Even though this field is optional, it is required for [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API and we will fail the request if not provided.
--http-operation-path-description=HTTP_OPERATION_PATH_DESCRIPTION- A short description for the path applicable to all operations.
- Details describing an MCP Tool.
--mcp-tool-name=MCP_TOOL_NAME-
The name of the tool, unique within its parent scope (version).
This flag argument must be specified if any of the other arguments in this group are specified.
--mcp-tool-description=MCP_TOOL_DESCRIPTION- Description of what the tool does.
- The operation schema needed for an operation.
- Arguments for the value.
--mcp-tool-input-schema-json=MCP_TOOL_INPUT_SCHEMA_JSON- The JSON schema. Only valid JSON is accepted but semantic validation of schema is not supported right now.
- The operation schema needed for an operation.
- Arguments for the value.
--mcp-tool-output-schema-json=MCP_TOOL_OUTPUT_SCHEMA_JSON- The JSON schema. Only valid JSON is accepted but semantic validation of schema is not supported right now.
--mcp-tool-title=MCP_TOOL_TITLE- Optional title for the tool.
- Annotations for a Tool.
--mcp-tool-annotations-additional-hints=[MCP_TOOL_ANNOTATIONS_ADDITIONAL_HINTS,…]-
Additional hints which may help tools and not covered in defaults.
KEY-
Sets KEY
value. VALUE-
Sets VALUE
value.
Shorthand Example:--mcp-tool-annotations-additional-hints=string=string
JSON Example:--mcp-tool-annotations-additional-hints='{"string": "string"}'
File Example:--mcp-tool-annotations-additional-hints=path_to_file.(yaml|json)
- Arguments for the destructive hint.
--mcp-tool-annotations-destructive-hint- Hint indicating if the tool may have destructive side effects.
- Arguments for the idempotent hint.
--mcp-tool-annotations-idempotent-hint- Hint indicating if the tool is idempotent.
- Arguments for the open world hint.
--mcp-tool-annotations-open-world-hint- Hint indicating if the tool interacts with the open world (e.g., internet).
- Arguments for the read only hint.
--mcp-tool-annotations-read-only-hint- Hint indicating if the tool is read-only.
--mcp-tool-annotations-title=MCP_TOOL_ANNOTATIONS_TITLE- A human-readable title for the tool (if different from Tool.title).
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - API REFERENCE
-
This command uses the
apihub/v1API. The full documentation for this API can be found at: https://cloud.google.com/apigee/docs/api-hub/what-is-api-hub - NOTES
-
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation-only early access
allowlist. This variant is also available:
gcloud apihub apis versions operations create
gcloud alpha apihub apis versions operations create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-24 UTC.