MCP Tools Reference: logging.googleapis.com

Tool: list_log_names

Use this as the primary tool to list the log names in a Google Cloud project. This is useful for discovering what logs are available for a project. Only logs which have log entries will be listed.

The following sample demonstrate how to use curl to invoke the list_log_names MCP tool.

Curl Request
                  
curl --location 'https://logging.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "list_log_names",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

Input Schema

The parameters to ListLogs.

ListLogsRequest

JSON representation
{
  "parent": string,
  "resourceNames": [
    string
  ],
  "pageSize": integer,
  "pageToken": string
}
Fields
parent

string

Required. The resource name to list logs for:

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]
resourceNames[]

string

Optional. List of resource names to list logs for:

  • projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]

To support legacy queries, it could also be:

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]

The resource name in the parent field is added to this list.

pageSize

integer

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

pageToken

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

Output Schema

Result returned from ListLogs.

ListLogsResponse

JSON representation
{
  "logNames": [
    string
  ],
  "nextPageToken": string
}
Fields
logNames[]

string

A list of log names. For example, "projects/my-project/logs/syslog" or "organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity".

nextPageToken

string

If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.

Tool Annotations

Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌