Tool: list_attributes
List all attributes.
The following sample demonstrate how to use curl to invoke the list_attributes MCP tool.
| Curl Request |
|---|
curl --location 'https://apihub.REGION.rep.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "list_attributes", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Where, REGION is the supported API hub region. For more information, see Supported regions.
Input Schema
The ListAttributes method's request.
ListAttributesRequest
| JSON representation |
|---|
{ "parent": string, "filter": string, "pageSize": integer, "pageToken": string } |
| Fields | |
|---|---|
parent |
Required. The parent resource for Attribute. Format: |
filter |
Optional. An expression that filters the list of Attributes. A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string or a boolean. The comparison operator must be one of: The following fields in the
Expressions are combined with either Here are a few examples:
|
pageSize |
Optional. The maximum number of attribute resources to return. The service may return fewer than this value. If unspecified, at most 50 attributes will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
pageToken |
Optional. A page token, received from a previous When paginating, all other parameters provided to |
Output Schema
The ListAttributes method's response.
ListAttributesResponse
| JSON representation |
|---|
{
"attributes": [
{
object ( |
| Fields | |
|---|---|
attributes[] |
The list of all attributes. |
nextPageToken |
A token, which can be sent as |
Attribute
| JSON representation |
|---|
{ "name": string, "displayName": string, "description": string, "definitionType": enum ( |
| Fields | |
|---|---|
name |
Identifier. The name of the attribute in the API Hub. Format: |
displayName |
Required. The display name of the attribute. |
description |
Optional. The description of the attribute. |
definitionType |
Output only. The definition type of the attribute. |
scope |
Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked. |
dataType |
Required. The type of the data of the attribute. |
allowedValues[] |
Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000. |
cardinality |
Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute. |
mandatory |
Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory. |
createTime |
Output only. The time at which the attribute 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 attribute 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: |
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. |
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. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌