public abstract class CloudApiRegistryClientReference documentation and code samples for the Cloud API Registry v1 API class CloudApiRegistryClient.
CloudApiRegistry client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.ApiRegistry.V1Assembly
Google.Cloud.ApiRegistry.V1.dll
Remarks
The Cloud API Registry service provides a central registry for managing API Data.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }The default endpoint for the CloudApiRegistry service, which is a host of "cloudapiregistry.googleapis.com" and a port of 443.
| Property Value | |
|---|---|
| Type | Description |
string |
|
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }The default CloudApiRegistry scopes.
| Property Value | |
|---|---|
| Type | Description |
IReadOnlyListstring |
|
The default CloudApiRegistry scopes are:
GrpcClient
public virtual CloudApiRegistry.CloudApiRegistryClient GrpcClient { get; }The underlying gRPC CloudApiRegistry client
| Property Value | |
|---|---|
| Type | Description |
CloudApiRegistryCloudApiRegistryClient |
|
LocationsClient
public virtual LocationsClient LocationsClient { get; }The LocationsClient associated with this client.
| Property Value | |
|---|---|
| Type | Description |
LocationsClient |
|
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }The service metadata associated with this client type.
| Property Value | |
|---|---|
| Type | Description |
ServiceMetadata |
|
Methods
Create()
public static CloudApiRegistryClient Create()Synchronously creates a CloudApiRegistryClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudApiRegistryClientBuilder.
| Returns | |
|---|---|
| Type | Description |
CloudApiRegistryClient |
The created CloudApiRegistryClient. |
CreateAsync(CancellationToken)
public static Task<CloudApiRegistryClient> CreateAsync(CancellationToken cancellationToken = default)Asynchronously creates a CloudApiRegistryClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudApiRegistryClientBuilder.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenThe CancellationToken to use while creating the client. |
| Returns | |
|---|---|
| Type | Description |
TaskCloudApiRegistryClient |
The task representing the created CloudApiRegistryClient. |
GetMcpServer(GetMcpServerRequest, CallSettings)
public virtual McpServer GetMcpServer(GetMcpServerRequest request, CallSettings callSettings = null)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
request |
GetMcpServerRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
McpServer |
The RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
GetMcpServerRequest request = new GetMcpServerRequest
{
McpServerName = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]"),
};
// Make the request
McpServer response = cloudApiRegistryClient.GetMcpServer(request);
GetMcpServer(McpServerName, CallSettings)
public virtual McpServer GetMcpServer(McpServerName name, CallSettings callSettings = null)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
name |
McpServerNameRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
McpServer |
The RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
McpServerName name = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]");
// Make the request
McpServer response = cloudApiRegistryClient.GetMcpServer(name);
GetMcpServer(string, CallSettings)
public virtual McpServer GetMcpServer(string name, CallSettings callSettings = null)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
McpServer |
The RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]";
// Make the request
McpServer response = cloudApiRegistryClient.GetMcpServer(name);
GetMcpServerAsync(GetMcpServerRequest, CallSettings)
public virtual Task<McpServer> GetMcpServerAsync(GetMcpServerRequest request, CallSettings callSettings = null)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
request |
GetMcpServerRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpServer |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
GetMcpServerRequest request = new GetMcpServerRequest
{
McpServerName = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]"),
};
// Make the request
McpServer response = await cloudApiRegistryClient.GetMcpServerAsync(request);
GetMcpServerAsync(GetMcpServerRequest, CancellationToken)
public virtual Task<McpServer> GetMcpServerAsync(GetMcpServerRequest request, CancellationToken cancellationToken)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
request |
GetMcpServerRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpServer |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
GetMcpServerRequest request = new GetMcpServerRequest
{
McpServerName = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]"),
};
// Make the request
McpServer response = await cloudApiRegistryClient.GetMcpServerAsync(request);
GetMcpServerAsync(McpServerName, CallSettings)
public virtual Task<McpServer> GetMcpServerAsync(McpServerName name, CallSettings callSettings = null)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
name |
McpServerNameRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpServer |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
McpServerName name = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]");
// Make the request
McpServer response = await cloudApiRegistryClient.GetMcpServerAsync(name);
GetMcpServerAsync(McpServerName, CancellationToken)
public virtual Task<McpServer> GetMcpServerAsync(McpServerName name, CancellationToken cancellationToken)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
name |
McpServerNameRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server} |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpServer |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
McpServerName name = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]");
// Make the request
McpServer response = await cloudApiRegistryClient.GetMcpServerAsync(name);
GetMcpServerAsync(string, CallSettings)
public virtual Task<McpServer> GetMcpServerAsync(string name, CallSettings callSettings = null)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpServer |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]";
// Make the request
McpServer response = await cloudApiRegistryClient.GetMcpServerAsync(name);
GetMcpServerAsync(string, CancellationToken)
public virtual Task<McpServer> GetMcpServerAsync(string name, CancellationToken cancellationToken)Gets a single McpServer.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server} |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpServer |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]";
// Make the request
McpServer response = await cloudApiRegistryClient.GetMcpServerAsync(name);
GetMcpTool(GetMcpToolRequest, CallSettings)
public virtual McpTool GetMcpTool(GetMcpToolRequest request, CallSettings callSettings = null)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
request |
GetMcpToolRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
McpTool |
The RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
GetMcpToolRequest request = new GetMcpToolRequest
{
McpToolName = McpToolName.FromProjectLocationApiNamespaceMcpServerMcpTool("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]"),
};
// Make the request
McpTool response = cloudApiRegistryClient.GetMcpTool(request);
GetMcpTool(McpToolName, CallSettings)
public virtual McpTool GetMcpTool(McpToolName name, CallSettings callSettings = null)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
name |
McpToolNameRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
McpTool |
The RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
McpToolName name = McpToolName.FromProjectLocationApiNamespaceMcpServerMcpTool("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]");
// Make the request
McpTool response = cloudApiRegistryClient.GetMcpTool(name);
GetMcpTool(string, CallSettings)
public virtual McpTool GetMcpTool(string name, CallSettings callSettings = null)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
McpTool |
The RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]/mcpTools/[MCP_TOOL]";
// Make the request
McpTool response = cloudApiRegistryClient.GetMcpTool(name);
GetMcpToolAsync(GetMcpToolRequest, CallSettings)
public virtual Task<McpTool> GetMcpToolAsync(GetMcpToolRequest request, CallSettings callSettings = null)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
request |
GetMcpToolRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpTool |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
GetMcpToolRequest request = new GetMcpToolRequest
{
McpToolName = McpToolName.FromProjectLocationApiNamespaceMcpServerMcpTool("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]"),
};
// Make the request
McpTool response = await cloudApiRegistryClient.GetMcpToolAsync(request);
GetMcpToolAsync(GetMcpToolRequest, CancellationToken)
public virtual Task<McpTool> GetMcpToolAsync(GetMcpToolRequest request, CancellationToken cancellationToken)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
request |
GetMcpToolRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpTool |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
GetMcpToolRequest request = new GetMcpToolRequest
{
McpToolName = McpToolName.FromProjectLocationApiNamespaceMcpServerMcpTool("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]"),
};
// Make the request
McpTool response = await cloudApiRegistryClient.GetMcpToolAsync(request);
GetMcpToolAsync(McpToolName, CallSettings)
public virtual Task<McpTool> GetMcpToolAsync(McpToolName name, CallSettings callSettings = null)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
name |
McpToolNameRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpTool |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
McpToolName name = McpToolName.FromProjectLocationApiNamespaceMcpServerMcpTool("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]");
// Make the request
McpTool response = await cloudApiRegistryClient.GetMcpToolAsync(name);
GetMcpToolAsync(McpToolName, CancellationToken)
public virtual Task<McpTool> GetMcpToolAsync(McpToolName name, CancellationToken cancellationToken)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
name |
McpToolNameRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool} |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpTool |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
McpToolName name = McpToolName.FromProjectLocationApiNamespaceMcpServerMcpTool("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]");
// Make the request
McpTool response = await cloudApiRegistryClient.GetMcpToolAsync(name);
GetMcpToolAsync(string, CallSettings)
public virtual Task<McpTool> GetMcpToolAsync(string name, CallSettings callSettings = null)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool} |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpTool |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]/mcpTools/[MCP_TOOL]";
// Make the request
McpTool response = await cloudApiRegistryClient.GetMcpToolAsync(name);
GetMcpToolAsync(string, CancellationToken)
public virtual Task<McpTool> GetMcpToolAsync(string name, CancellationToken cancellationToken)Gets a single McpTool.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. Name of the resource Format: projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool} |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMcpTool |
A Task containing the RPC response. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]/mcpTools/[MCP_TOOL]";
// Make the request
McpTool response = await cloudApiRegistryClient.GetMcpToolAsync(name);
ListMcpServers(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListMcpServersResponse, McpServer> ListMcpServers(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpServers in a given Project.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Parent value for ListMcpServersRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListMcpServersResponseMcpServer |
A pageable sequence of McpServer resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListMcpServersResponse, McpServer> response = cloudApiRegistryClient.ListMcpServers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (McpServer item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMcpServersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpServer item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpServer> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpServer item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpServers(ListMcpServersRequest, CallSettings)
public virtual PagedEnumerable<ListMcpServersResponse, McpServer> ListMcpServers(ListMcpServersRequest request, CallSettings callSettings = null)Lists McpServers in a given Project.
| Parameters | |
|---|---|
| Name | Description |
request |
ListMcpServersRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListMcpServersResponseMcpServer |
A pageable sequence of McpServer resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
ListMcpServersRequest request = new ListMcpServersRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable<ListMcpServersResponse, McpServer> response = cloudApiRegistryClient.ListMcpServers(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (McpServer item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMcpServersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpServer item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpServer> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpServer item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpServers(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListMcpServersResponse, McpServer> ListMcpServers(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpServers in a given Project.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Parent value for ListMcpServersRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListMcpServersResponseMcpServer |
A pageable sequence of McpServer resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListMcpServersResponse, McpServer> response = cloudApiRegistryClient.ListMcpServers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (McpServer item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMcpServersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpServer item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpServer> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpServer item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpServersAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListMcpServersResponse, McpServer> ListMcpServersAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpServers in a given Project.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Parent value for ListMcpServersRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListMcpServersResponseMcpServer |
A pageable asynchronous sequence of McpServer resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListMcpServersResponse, McpServer> response = cloudApiRegistryClient.ListMcpServersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (McpServer item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListMcpServersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpServer item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpServer> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpServer item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpServersAsync(ListMcpServersRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListMcpServersResponse, McpServer> ListMcpServersAsync(ListMcpServersRequest request, CallSettings callSettings = null)Lists McpServers in a given Project.
| Parameters | |
|---|---|
| Name | Description |
request |
ListMcpServersRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListMcpServersResponseMcpServer |
A pageable asynchronous sequence of McpServer resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
ListMcpServersRequest request = new ListMcpServersRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListMcpServersResponse, McpServer> response = cloudApiRegistryClient.ListMcpServersAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (McpServer item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListMcpServersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpServer item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpServer> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpServer item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpServersAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListMcpServersResponse, McpServer> ListMcpServersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpServers in a given Project.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Parent value for ListMcpServersRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListMcpServersResponseMcpServer |
A pageable asynchronous sequence of McpServer resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListMcpServersResponse, McpServer> response = cloudApiRegistryClient.ListMcpServersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (McpServer item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListMcpServersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpServer item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpServer> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpServer item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpTools(ListMcpToolsRequest, CallSettings)
public virtual PagedEnumerable<ListMcpToolsResponse, McpTool> ListMcpTools(ListMcpToolsRequest request, CallSettings callSettings = null)Lists McpTools in a given McpServer.
| Parameters | |
|---|---|
| Name | Description |
request |
ListMcpToolsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListMcpToolsResponseMcpTool |
A pageable sequence of McpTool resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
ListMcpToolsRequest request = new ListMcpToolsRequest
{
ParentAsMcpServerName = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable<ListMcpToolsResponse, McpTool> response = cloudApiRegistryClient.ListMcpTools(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (McpTool item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMcpToolsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpTool item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpTool> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpTool item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpTools(McpServerName, string, int?, CallSettings)
public virtual PagedEnumerable<ListMcpToolsResponse, McpTool> ListMcpTools(McpServerName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpTools in a given McpServer.
| Parameters | |
|---|---|
| Name | Description |
parent |
McpServerNameRequired. Parent value for ListMcpToolsRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListMcpToolsResponseMcpTool |
A pageable sequence of McpTool resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
McpServerName parent = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]");
// Make the request
PagedEnumerable<ListMcpToolsResponse, McpTool> response = cloudApiRegistryClient.ListMcpTools(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (McpTool item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMcpToolsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpTool item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpTool> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpTool item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpTools(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListMcpToolsResponse, McpTool> ListMcpTools(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpTools in a given McpServer.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Parent value for ListMcpToolsRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListMcpToolsResponseMcpTool |
A pageable sequence of McpTool resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]";
// Make the request
PagedEnumerable<ListMcpToolsResponse, McpTool> response = cloudApiRegistryClient.ListMcpTools(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (McpTool item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMcpToolsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpTool item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpTool> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpTool item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpToolsAsync(ListMcpToolsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListMcpToolsResponse, McpTool> ListMcpToolsAsync(ListMcpToolsRequest request, CallSettings callSettings = null)Lists McpTools in a given McpServer.
| Parameters | |
|---|---|
| Name | Description |
request |
ListMcpToolsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListMcpToolsResponseMcpTool |
A pageable asynchronous sequence of McpTool resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
ListMcpToolsRequest request = new ListMcpToolsRequest
{
ParentAsMcpServerName = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListMcpToolsResponse, McpTool> response = cloudApiRegistryClient.ListMcpToolsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (McpTool item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListMcpToolsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpTool item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpTool> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpTool item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpToolsAsync(McpServerName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListMcpToolsResponse, McpTool> ListMcpToolsAsync(McpServerName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpTools in a given McpServer.
| Parameters | |
|---|---|
| Name | Description |
parent |
McpServerNameRequired. Parent value for ListMcpToolsRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListMcpToolsResponseMcpTool |
A pageable asynchronous sequence of McpTool resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
McpServerName parent = McpServerName.FromProjectLocationApiNamespaceMcpServer("[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]");
// Make the request
PagedAsyncEnumerable<ListMcpToolsResponse, McpTool> response = cloudApiRegistryClient.ListMcpToolsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (McpTool item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListMcpToolsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpTool item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpTool> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpTool item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMcpToolsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListMcpToolsResponse, McpTool> ListMcpToolsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists McpTools in a given McpServer.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Parent value for ListMcpToolsRequest |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListMcpToolsResponseMcpTool |
A pageable asynchronous sequence of McpTool resources. |
// Create client
CloudApiRegistryClient cloudApiRegistryClient = await CloudApiRegistryClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apiNamespaces/[API_NAMESPACE]/mcpServers/[MCP_SERVER]";
// Make the request
PagedAsyncEnumerable<ListMcpToolsResponse, McpTool> response = cloudApiRegistryClient.ListMcpToolsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (McpTool item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListMcpToolsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (McpTool item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<McpTool> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (McpTool item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
| Returns | |
|---|---|
| Type | Description |
Task |
A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.