Tool: search_projects
Searches for Google Cloud projects. This tool may be used whenever any tools or conversation context requires a GCP project. A SearchProjects call with an empty query will return all projects the user has access to, which can be used to determine a curated list of projects. The tool can find projects by parent (e.g., 'parent:folders/223'), project ID (e.g., 'projectId:my-project-id'), or other filters.
The following sample demonstrate how to use curl to invoke the search_projects MCP tool.
| Curl Request |
|---|
curl --location 'https://cloudresourcemanager.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "search_projects", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
The request sent to the SearchProjects method.
SearchProjectsRequest
| JSON representation |
|---|
{ "query": string, "pageToken": string, "pageSize": integer } |
| Fields | |
|---|---|
query |
Optional. A query string for searching for projects that the caller has Search expressions are case insensitive. Some examples queries: If no query is specified, the call will return projects for which the user has the |
pageToken |
Optional. A pagination token returned from a previous call to |
pageSize |
Optional. The maximum number of projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default. |
Output Schema
A page of the response received from the SearchProjects method.
A paginated response where more pages are available has next_page_token set. This token can be used in a subsequent request to retrieve the next request page.
SearchProjectsResponse
| JSON representation |
|---|
{
"projects": [
{
object ( |
| Fields | |
|---|---|
projects[] |
The list of Projects that matched the list filter query. This list can be paginated. |
nextPageToken |
Pagination token. If the result set is too large to fit in a single response, this token is returned. It encodes the position of the current result cursor. Feeding this value into a new list request with the When Pagination tokens have a limited lifetime. |
Project
| JSON representation |
|---|
{
"name": string,
"parent": string,
"projectId": string,
"state": enum ( |
| Fields | |
|---|---|
name |
Output only. The unique resource name of the project. It is an int64 generated number prefixed by "projects/". Example: |
parent |
Optional. A reference to a parent Resource. eg., |
projectId |
Immutable. The unique, user-assigned id of the project. It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: |
state |
Output only. The project lifecycle state. |
displayName |
Optional. A user-assigned display name of the project. When present it must be between 4 to 30 characters. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. Example: |
createTime |
Output only. Creation time. 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 most recent time this resource was modified. 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: |
deleteTime |
Output only. The time at which this resource was requested for deletion. 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: |
etag |
Output only. A checksum computed by the server based on the current value of the Project resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. |
labels |
Optional. The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])?. Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. No more than 64 labels can be associated with a given resource. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: An object containing a list of |
tags |
Optional. Input only. Immutable. Tag keys/values directly bound to this project. Each item in the map must be expressed as " Note: Currently this field is in Preview. An object containing a list of |
configuredCapabilities[] |
Output only. If this project is a Management Project, list of capabilities configured on the parent folder. Note, presence of any capability implies that this is a Management Project. Example: |
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. |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
TagsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ✅