Skip to main content
Glama

port_forward

Manage Kubernetes pod port forwarding: start, stop, and list active sessions. Forward local ports to pod ports, with optional idle timeout to auto-stop inactive connections.

Instructions

Pod 端口转发管理:启动、停止、列出转发会话

Args: action: 操作类型 - "start"(启动转发)、"stop"(停止转发)、"list"(列出当前转发) pod_name: start 时必填,Pod 名称 local_port: start 时必填,本地端口(1-65535) pod_port: start 时必填,Pod 端口(1-65535) namespace: Kubernetes 命名空间,默认 default forward_id: stop 时必填,要停止的转发会话 ID(由 start 返回或 list 查看) idle_timeout: start 时可选,空闲超时秒数(0=不超时)。超过此时间无连接活动则自动停止转发 kubeconfig_path: kubeconfig 文件路径 cluster_name: 集群配置名称

Returns: start: 转发会话信息(含 forward_id); stop: 停止确认; list: 所有活跃转发

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNostart
pod_nameNo
pod_portNo
namespaceNodefault
forward_idNo
local_portNo
cluster_nameNo
idle_timeoutNo
kubeconfig_pathNo
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the idle_timeout behavior (automatic stop after inactivity) and return values for each action. It does not elaborate on underlying network mechanics or prerequisites like kubeconfig validity, but it provides meaningful behavioral context beyond a bare function statement.

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

Conciseness4/5

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

The description is organized with a one-line summary followed by an Args list and Returns section. It is somewhat long due to the 9 parameters, but every sentence adds value and the structure helps readability. It could be more concise, but the density is appropriate for the tool's complexity.

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

Completeness5/5

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

Given the tool's complexity (9 parameters, no annotations, no output schema), the description is remarkably complete. It covers all parameters, describes the return values for each action, and explains conditional requirements and idle timeout behavior. No important usage aspect is left unexplained.

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

Parameters5/5

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

Schema description coverage is 0%, so the description is the only source of parameter meaning. It explains every parameter in detail, including conditional requirements (pod_name/local_port/pod_port required for start, forward_id for stop), defaults (namespace default 'default'), ranges (ports 1-65535), and idle_timeout semantics.

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 clearly states the tool's function: 'Pod 端口转发管理:启动、停止、列出转发会话' (Pod port forwarding management: start, stop, list sessions). This specifies the verb (manage/start/stop/list) and resource (port forwarding), effectively distinguishing it from sibling tools like get_pod_logs or exec_pod_command.

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

Usage Guidelines4/5

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

The description provides clear context for each action (start/stop/list) and the parameters required for each. It does not explicitly name alternative tools for port forwarding, but within the sibling set no other tool handles port forwarding. Therefore, it gives sufficient guidance on when to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tobewont/k8s-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server