Skip to main content
Glama
ranson21

kube-diagnostics-mcp

by ranson21

scan_logs_for_sensitive_data

Scan Kubernetes logs to detect PII and secrets, returning masked samples and counts to prevent data leaks.

Instructions

Scans recent logs for PII (emails, cards with Luhn, SSNs, phones) and secrets (JWTs, cloud keys, Bearer/Basic, connection strings, PEM). Returns counts and masked samples only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
podNoExact pod name (alternative to service)
sinceNoTime window like 15m, 2h, 1d (default 1h)
serviceNoWorkload name as you would say it: a Deployment, StatefulSet, DaemonSet, Service, or Pod name
namespaceNoKubernetes namespace (required: no default configured; see list_namespaces)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It adds meaningful transparency by stating that only counts and masked samples are returned, preventing an agent from expecting raw sensitive data. It also scopes the behavior to 'recent logs.' It does not mention access/permission requirements, but 'scans' strongly implies a read-only, non-destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one focused sentence that front-loads the action and scope, enumerates categories compactly, and ends with the output constraint. Every clause adds information; there is no repetition of the tool name or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete enough for invocation: it defines the scan scope, the output format, and the recent-log time notion, while the schema documents the parameters. It could mention the namespace requirement or that output is grouped by category, but these are minor gaps given the schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the parameters are already documented and the baseline is 3. The description does not add parameter-level detail beyond the schema, such as explaining the pod-vs-service relationship or the since format, but it does not need to fully compensate because the schema handles it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('scans recent logs') and enumerates exact detection categories (PII types and secret types), plus the output form (counts and masked samples). This clearly distinguishes it from sibling tools like get_logs, summarize_log_errors, and get_secret_usage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use case is inferable from 'scans recent logs for PII... and secrets,' but the description never explicitly says when to use this tool over alternatives such as get_secret_usage or security_posture. No when-not-to-use guidance is provided, leaving the agent to infer trade-offs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.