Detach a resource from an app
detach_resourceDetach a resource from an app: remove the environment variables it set and, if the app is running, ask for a restart so its next process starts without them. The state is detached when that is done, and detaching while Valet still owes the restart or the removal, which it keeps trying; the answer gives the reason. The running process keeps the variables until it is replaced. A variable whose value is not the one the resource set stays on the app, and the answer names it. The resource itself and its data are unchanged, and other apps that hold it keep it. Detaching a resource that is not attached changes nothing. Credentials in that text are redacted on a best-effort basis: a secret value the service holds, or a string shaped like an API key, private key, token, or password, reads [redacted], and redactions counts them. Requires connecting a Valet account.
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": {
"name": "<name>",
"resource": "<resource>"
},
"name": "detach_resource"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The app's name, as list_services shows it: the app to detach the resource from. | |
| org_name | No | The Valet organization the app belongs to. Omit to use the organization the account joined first. | |
| resource | Yes | The resource's name in the organization. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Name of the Valet organization the call acted in. | |
| name | Yes | Name of the app the resource was detached from. | |
| plan | No | Plan the resource runs on. Absent for a resource created from environment variables. | |
| state | Yes | detached when the detach finished, or detaching when Valet accepted it and keeps removing the variables in the background (reason says why). A resource that was not attached to the app also reads detached. | |
| reason | No | Why a failed resource failed, as the provider said, or why the attachment is attaching, detaching, or conflicted. Absent when there is nothing to explain. | |
| env_vars | No | Names of the environment variables the detach removed from the app. Never their values. | |
| provider | No | Provider the resource was provisioned from. Absent for a resource created from environment variables. | |
| resource | Yes | Name of the resource detached, which stays in the organization. Pass it to destroy_resource to delete it. | |
| redactions | Yes | How many credentials were replaced with [redacted] in the text this answer was built from: secret values the service holds, and strings shaped like an API key, a private key, a token, or a password in a URL or header. Redaction is best effort, so 0 does not prove the text holds no credential. | |
| resource_id | No | ID of the resource. Absent when the call stopped before it found or created one. | |
| kept_env_vars | No | Names of variables a detach left on the app because their values are not the ones the resource set. Absent when it kept none. |