Lock or Unlock Port
set_port_lockLock or unlock an HTTPS port exposed by a pod without restarting it: locking restricts access to signed-in workspace members and valid access keys; unlocking makes the app public.
Instructions
Lock or unlock one port a pod exposes over HTTPS. The pod isn't restarted. The change takes a few seconds to take effect: the answer's state is locking or unlocking until it does (read lock_state with the pods tool). Repeating the call doesn't speed this up: wait by reading lock_state with the pods tool instead.
locked=true locks it at once, without confirm: only workspace members signed in to the console and requests that carry one of the port's access keys (create_access_key) get through. Everything else gets 401, also programs that called the port without a key until now, so tell the user.
locked=false unlocks it: anyone who knows the URL can then reach the app, with no sign-in and no key. Do it only when the user explicitly asks. With confirm=false (default) it only returns a summary and changes nothing; call again with confirm=true and the summary's pod_name after the user agreed. The port's access keys are kept and work again once it is locked.
Only a workspace admin or billing member can change a lock. An internal port has no lock (port_not_public).
Every write requires operation_id. Reuse the ID returned by the preview, or generate a UUID before the first call. Keep it for confirmation and all retries; a new ID means a new operation. After a timeout, check operation_status and resource state before retrying.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pod": "<pod>",
"port": "<port>",
"locked": "<locked>"
},
"name": "set_port_lock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pod | Yes | The pod_name from the pods tool. Its display name also works, except on a confirmed call (confirm=true) that opens a port, changes a key or signs out browsers: use the `pod_name` the preview returned. | |
| port | Yes | The port number, from the pod's `endpoints` in the pods tool; it must be exposed over HTTPS (`access` locked or unlocked). | |
| locked | Yes | ||
| confirm | No | ||
| workspace | No | ||
| operation_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||