# get_k8s_logs

Gets logs from a Kubernetes container in a pod. This is similar to running kubectl logs.

Agent View of the PolicyLayer registry record for `get_k8s_logs`. HTML page: https://policylayer.com/tools/com-googleapis-container-mcp/get-k8s-logs

## Facts

- Tool: `get_k8s_logs`
- Server: Mcp (`https://container.googleapis.com/mcp`) — https://policylayer.com/tools/com-googleapis-container-mcp.md
- Homepage: https://github.com/https://container.googleapis.com/mcp
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 10 (2 required)
- Recommended policy verdict: Allowed

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | Required. The name of the resource to retrieve logs from. This can be a pod name (e.g. "my-pod") or a type/name (e.g. "deployment/my-deployment"). If a type is |
| `tail` | string | no | Optional. The number of lines from the end of the logs to show. |
| `since` | string | no | Optional. Retrieve logs since this duration ago (e.g. "1h", "10m"). |
| `parent` | string | yes | Required. The cluster to retrieve logs from. Format: projects/{project}/locations/{location}/clusters/{cluster} |
| `previous` | boolean | no | Optional. If true, retrieve logs from the previous instantiation of the container. |
| `container` | string | no | Optional. The name of the container to retrieve logs from. If not specified, logs from the first container are returned. |
| `namespace` | string | no | Optional. The namespace of the resource. If not specified, "default" is used. |
| `sinceTime` | string | no | Optional. Retrieve logs since this time (RFC3339). e.g. "2024-08-30T06:00:00Z". |
| `timestamps` | boolean | no | Optional. If true, include timestamps in the log output. |
| `allContainers` | boolean | no | Optional. If true, retrieve logs from all containers in the pod. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_k8s_logs",
    "arguments": {
      "name": "<name>",
      "parent": "<parent>"
    }
  }
}
```

## Why get_k8s_logs is rated Low

This tool retrieves existing log data from Kubernetes containers, which is a pure read operation with no side effects. It does not create, modify, delete, or execute any code. The server description confirms it 'Provides read access' to Kubernetes resources. The blast radius of misuse is minimal—an agent could read sensitive logs but cannot alter cluster state or infrastructure.

From the tool's own definition: "Tool description states 'Gets logs from a Kubernetes container in a pod' and explicitly compares it to `kubectl logs`, which is a read-only operation that retrieves log output without modifying any resources."

Risk signals: High parameter count (10 properties)

## Use case

AI agents call get_k8s_logs to retrieve information from Mcp without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Mcp:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "get_k8s_logs": {}
  }
}
```

## Other tools on Mcp (22)

- `delete_k8s_resource` — Destructive — https://policylayer.com/tools/com-googleapis-container-mcp/delete-k8s-resource.md
- `cancel_operation` — Execute — https://policylayer.com/tools/com-googleapis-container-mcp/cancel-operation.md
- `check_k8s_auth` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/check-k8s-auth.md
- `describe_k8s_resource` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/describe-k8s-resource.md
- `get_cluster` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-cluster.md
- `get_k8s_cluster_info` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-k8s-cluster-info.md
- `get_k8s_resource` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-k8s-resource.md
- `get_k8s_rollout_status` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-k8s-rollout-status.md
- `get_k8s_version` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-k8s-version.md
- `get_node_pool` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-node-pool.md
- `get_operation` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/get-operation.md
- `list_clusters` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/list-clusters.md
- `list_k8s_api_resources` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/list-k8s-api-resources.md
- `list_k8s_events` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/list-k8s-events.md
- `list_node_pools` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/list-node-pools.md
- `list_operations` — Read — https://policylayer.com/tools/com-googleapis-container-mcp/list-operations.md
- `apply_k8s_manifest` — Write — https://policylayer.com/tools/com-googleapis-container-mcp/apply-k8s-manifest.md
- `create_cluster` — Write — https://policylayer.com/tools/com-googleapis-container-mcp/create-cluster.md
- `create_node_pool` — Write — https://policylayer.com/tools/com-googleapis-container-mcp/create-node-pool.md
- `patch_k8s_resource` — Write — https://policylayer.com/tools/com-googleapis-container-mcp/patch-k8s-resource.md
- `update_cluster` — Write — https://policylayer.com/tools/com-googleapis-container-mcp/update-cluster.md
- `update_node_pool` — Write — https://policylayer.com/tools/com-googleapis-container-mcp/update-node-pool.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=com-googleapis-container-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-googleapis-container-mcp
