Tool: retrieve_api_views
Retrieve API views in the API hub.
The following sample demonstrate how to use curl to invoke the retrieve_api_views MCP tool.
| Curl Request |
|---|
curl --location 'https://apihub.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "retrieve_api_views", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
The [RetrieveApiViews][ApiHubInternal.RetrieveApiViews] method's request.
RetrieveApiViewsRequest
| JSON representation |
|---|
{
"parent": string,
"filter": string,
"pageSize": integer,
"pageToken": string,
"view": enum ( |
| Fields | |
|---|---|
parent |
Required. The parent resource name. Format: |
filter |
Optional. The filter expression. |
pageSize |
Optional. The maximum number of results to return. Default to 100. |
pageToken |
Optional. A page token, received from a previous |
view |
Required. The view type to return. |
ApiViewType
The view type of API.
| Enums | |
|---|---|
API_VIEW_TYPE_UNSPECIFIED |
The default view type. |
MCP_SERVER |
The MCP server view in API hub. |
MCP_TOOL |
The MCP tool view in API hub. |
Output Schema
The [RetrieveApiViews][ApiHubInternal.RetrieveApiViews] method's response.
RetrieveApiViewsResponse
| JSON representation |
|---|
{
"apiViews": [
{
object ( |
| Fields | |
|---|---|
apiViews[] |
Output only. The list of API views. |
nextPageToken |
Next page token. |
ApiView
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field view. API view. view can be only one of the following: |
|
mcpServerView |
MCP server view. |
mcpToolView |
MCP tools view. |
FlattenedApiVersionDeploymentView
| JSON representation |
|---|
{ "api": { object ( |
| Fields | |
|---|---|
api |
Optional. The API. |
version |
Optional. The version. |
deployment |
Optional. The deployment. |
Api
| JSON representation |
|---|
{ "name": string, "displayName": string, "description": string, "documentation": { object ( |
| Fields | |
|---|---|
name |
Identifier. The name of the API resource in the API Hub. Format: |
displayName |
Required. The display name of the API resource. |
description |
Optional. The description of the API resource. |
documentation |
Optional. The documentation for the API resource. |
owner |
Optional. Owner details for the API resource. |
versions[] |
Output only. The list of versions present in an API resource. Note: An API resource can be associated with more than 1 version. Format is |
createTime |
Output only. The time at which the API resource 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: |
updateTime |
Output only. The time at which the API resource 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: |
targetUser |
Optional. The target users for the API. This maps to the following system defined attribute: |
team |
Optional. The team owning the API. This maps to the following system defined attribute: |
businessUnit |
Optional. The business unit owning the API. This maps to the following system defined attribute: |
maturityLevel |
Optional. The maturity level of the API. This maps to the following system defined attribute: |
attributes |
Optional. The list of user defined attributes associated with the API resource. The key is the attribute name. It will be of the format: An object containing a list of |
apiStyle |
Optional. The style of the API. This maps to the following system defined attribute: |
selectedVersion |
Optional. The selected version for an API resource. This can be used when special handling is needed on client side for particular version of the API. Format is |
apiRequirements |
Optional. The api requirement doc associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: |
fingerprint |
Optional. Fingerprint of the API resource. This must be unique for each API resource. It can neither be unset nor be updated to an existing fingerprint of another API resource. |
sourceMetadata[] |
Output only. The list of sources and metadata from the sources of the API resource. |
apiFunctionalRequirements |
Optional. The api functional requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: |
apiTechnicalRequirements |
Optional. The api technical requirements associated with the API resource. Carinality is 1 for this attribute. This maps to the following system defined attribute: |
Documentation
| JSON representation |
|---|
{ "externalUri": string } |
| Fields | |
|---|---|
externalUri |
Optional. The uri of the externally hosted documentation. |
Owner
| JSON representation |
|---|
{ "displayName": string, "email": string } |
| Fields | |
|---|---|
displayName |
Optional. The name of the owner. |
email |
Required. The email of the owner. |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos |
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
AttributeValues
| JSON representation |
|---|
{ "attribute": string, // Union field |
| Fields | |
|---|---|
attribute |
Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute} |
Union field Value. The attribute values associated with the resource. Value can be only one of the following: |
|
enumValues |
The attribute values associated with a resource in case attribute data type is enum. |
stringValues |
The attribute values associated with a resource in case attribute data type is string. |
jsonValues |
The attribute values associated with a resource in case attribute data type is 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. |
EnumAttributeValues
| JSON representation |
|---|
{
"values": [
{
object ( |
| Fields | |
|---|---|
values[] |
Required. The attribute values in case attribute data type is enum. |
AllowedValue
| JSON representation |
|---|
{ "id": string, "displayName": string, "description": string, "immutable": boolean } |
| Fields | |
|---|---|
id |
Required. 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]-/. |
displayName |
Required. The display name of the allowed value. |
description |
Optional. The detailed description of the allowed value. |
immutable |
Optional. When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes. |
StringAttributeValues
| JSON representation |
|---|
{ "values": [ string ] } |
| Fields | |
|---|---|
values[] |
Required. The attribute values in case attribute data type is string or JSON. |
AttributesEntry
| JSON representation |
|---|
{
"key": string,
"value": {
object ( |
| Fields | |
|---|---|
key |
|
value |
|
SourceMetadata
| JSON representation |
|---|
{ "sourceType": enum ( |
| Fields | |
|---|---|
sourceType |
Output only. The type of the source. |
originalResourceId |
Output only. The unique identifier of the resource at the source. |
originalResourceCreateTime |
Output only. The time at which the resource was created at the source. 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: |
originalResourceUpdateTime |
Output only. The time at which the resource was last updated at the source. 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: |
Union field source. The source of the resource. source can be only one of the following: |
|
pluginInstanceActionSource |
Output only. The source of the resource is a plugin instance action. |
PluginInstanceActionSource
| JSON representation |
|---|
{ "pluginInstance": string, "actionId": string } |
| Fields | |
|---|---|
pluginInstance |
Output only. The resource name of the source plugin instance. Format is |
actionId |
Output only. The id of the plugin instance action. |
Version
| JSON representation |
|---|
{ "name": string, "displayName": string, "description": string, "documentation": { object ( |
| Fields | |
|---|---|
name |
Identifier. The name of the version. Format: |
displayName |
Required. The display name of the version. |
description |
Optional. The description of the version. |
documentation |
Optional. The documentation of the version. |
specs[] |
Output only. The specs associated with this version. Note that an API version can be associated with multiple specs. Format is |
apiOperations[] |
Output only. The operations contained in the API version. These operations will be added to the version when a new spec is added or when an existing spec is updated. Format is |
definitions[] |
Output only. The definitions contained in the API version. These definitions will be added to the version when a new spec is added or when an existing spec is updated. Format is |
deployments[] |
Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc) Format is |
createTime |
Output only. The time at which the version 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: |
updateTime |
Output only. The time at which the version 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: |
lifecycle |
Optional. The lifecycle of the API version. This maps to the following system defined attribute: |
compliance |
Optional. The compliance associated with the API version. This maps to the following system defined attribute: |
accreditation |
Optional. The accreditations associated with the API version. This maps to the following system defined attribute: |
attributes |
Optional. The list of user defined attributes associated with the Version resource. The key is the attribute name. It will be of the format: An object containing a list of |
selectedDeployment |
Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is |
sourceMetadata[] |
Output only. The list of sources and metadata from the sources of the version. |
AttributesEntry
| JSON representation |
|---|
{
"key": string,
"value": {
object ( |
| Fields | |
|---|---|
key |
|
value |
|
Deployment
| JSON representation |
|---|
{ "name": string, "displayName": string, "description": string, "documentation": { object ( |
| Fields | |
|---|---|
name |
Identifier. The name of the deployment. Format: |
displayName |
Required. The display name of the deployment. |
description |
Optional. The description of the deployment. |
documentation |
Optional. The documentation of the deployment. |
deploymentType |
Required. The type of deployment. This maps to the following system defined attribute: |
resourceUri |
Required. The resource URI identifies the deployment within its gateway. For Apigee gateways, its recommended to use the format: organizations/{org}/environments/{env}/apis/{api}. For ex: if a proxy with name |
endpoints[] |
Required. The endpoints at which this deployment resource is listening for API requests. This could be a list of complete URIs, hostnames or an IP addresses. |
apiVersions[] |
Output only. The API versions linked to this deployment. Note: A particular deployment could be linked to multiple different API versions (of same or different APIs). |
createTime |
Output only. The time at which the deployment 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: |
updateTime |
Output only. The time at which the deployment 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: |
slo |
Optional. The SLO for this deployment. This maps to the following system defined attribute: |
environment |
Optional. The environment mapping to this deployment. This maps to the following system defined attribute: |
attributes |
Optional. The list of user defined attributes associated with the deployment resource. The key is the attribute name. It will be of the format: An object containing a list of |
sourceMetadata[] |
Output only. The list of sources and metadata from the sources of the deployment. |
managementUrl |
Optional. The uri where users can navigate to for the management of the deployment. This maps to the following system defined attribute: |
sourceUri |
Optional. The uri where additional source specific information for this deployment can be found. This maps to the following system defined attribute: |
sourceProject |
Optional. The project to which the deployment belongs. For Google Cloud gateways, this will refer to the project identifier. For others like Edge/OPDK, this will refer to the org identifier. |
sourceEnvironment |
Optional. The environment at source for the deployment. For example: prod, dev, staging, etc. |
AttributesEntry
| JSON representation |
|---|
{
"key": string,
"value": {
object ( |
| Fields | |
|---|---|
key |
|
value |
|
FlattenedApiVersionOperationDeploymentView
| JSON representation |
|---|
{ "api": { object ( |
| Fields | |
|---|---|
api |
Optional. The API. |
version |
Optional. The version. |
apiOperation |
Optional. The API operation. |
deployment |
Optional. The deployment. |
ApiOperation
| JSON representation |
|---|
{ "name": string, "spec": string, "details": { object ( |
| Fields | |
|---|---|
name |
Identifier. The name of the operation. Format: |
spec |
Output only. The name of the spec will be of the format: |
details |
Optional. Operation details. Note: Even though this field is optional, it is required for |
createTime |
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: |
updateTime |
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: |
attributes |
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: An object containing a list of |
sourceMetadata[] |
Output only. The list of sources and metadata from the sources of the API operation. |
OperationDetails
| JSON representation |
|---|
{ "description": string, "documentation": { object ( |
| Fields | |
|---|---|
description |
Optional. Description of the operation behavior. For OpenAPI spec, this will map to |
documentation |
Optional. Additional external documentation for this operation. For OpenAPI spec, this will map to |
deprecated |
Optional. For OpenAPI spec, this will be set if |
Union field
|
|
httpOperation |
The HTTP Operation. |
mcpTool |
The MCP Tool Operation. |
HttpOperation
| JSON representation |
|---|
{ "path": { object ( |
| Fields | |
|---|---|
path |
Optional. The path details for the Operation. Note: Even though this field is optional, it is required for |
method |
Optional. Operation method Note: Even though this field is optional, it is required for |
Path
| JSON representation |
|---|
{ "path": string, "description": string } |
| Fields | |
|---|---|
path |
Optional. Complete path relative to server endpoint. Note: Even though this field is optional, it is required for |
description |
Optional. A short description for the path applicable to all operations. |
McpTool
| JSON representation |
|---|
{ "name": string, "title": string, "description": string, "annotations": { object ( |
| Fields | |
|---|---|
name |
Required. The name of the tool, unique within its parent scope (version). |
title |
Optional. Optional title for the tool. |
description |
Optional. Description of what the tool does. |
annotations |
Optional. Optional annotations for the tool. |
inputSchema |
Optional. Input schema for the operation. This can be parsed only from MCP schema type. |
outputSchema |
Optional. Output schema for the operation. This can be parsed only from MCP schema type. |
ToolAnnotations
| JSON representation |
|---|
{ "title": string, "additionalHints": { string: string, ... }, // Union field |
| Fields | |
|---|---|
title |
Optional. A human-readable title for the tool (if different from Tool.title). |
additionalHints |
Optional. Additional hints which may help tools and not covered in defaults. An object containing a list of |
Union field
|
|
readOnlyHint |
Optional. Hint indicating if the tool is read-only. |
Union field
|
|
destructiveHint |
Optional. Hint indicating if the tool may have destructive side effects. |
Union field
|
|
idempotentHint |
Optional. Hint indicating if the tool is idempotent. |
Union field
|
|
openWorldHint |
Optional. Hint indicating if the tool interacts with the open world (e.g., internet). |
AdditionalHintsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
OperationSchema
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field value. The value of the schema. value can be only one of the following: |
|
jsonSchema |
The JSON schema. Only valid JSON is accepted but semantic validation of schema is not supported right now. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a JSON |
numberValue |
Represents a JSON number. Must not be |
stringValue |
Represents a JSON string. |
boolValue |
Represents a JSON boolean ( |
structValue |
Represents a JSON object. |
listValue |
Represents a JSON array. |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
AttributesEntry
| JSON representation |
|---|
{
"key": string,
"value": {
object ( |
| Fields | |
|---|---|
key |
|
value |
|
SourceType
The possible types of the source.
| Enums | |
|---|---|
SOURCE_TYPE_UNSPECIFIED |
Source type not specified. |
PLUGIN |
Source type plugin. |
Method
Enumeration of Method types.
| Enums | |
|---|---|
METHOD_UNSPECIFIED |
Method unspecified. |
GET |
Get Operation type. |
PUT |
Put Operation type. |
POST |
Post Operation type. |
DELETE |
Delete Operation type. |
OPTIONS |
Options Operation type. |
HEAD |
Head Operation type. |
PATCH |
Patch Operation type. |
TRACE |
Trace Operation type. |
NullValue
Represents a JSON null.
NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.
A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.
| Enums | |
|---|---|
NULL_VALUE |
Null value. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌