Skip to main content
Glama

Detach a resource from an app

detach_resource
Destructive

Detach 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

NameRequiredDescriptionDefault
nameYesThe app's name, as list_services shows it: the app to detach the resource from.
org_nameNoThe Valet organization the app belongs to. Omit to use the organization the account joined first.
resourceYesThe resource's name in the organization.

Output Schema

NameRequiredDescriptionDefault
orgYesName of the Valet organization the call acted in.
nameYesName of the app the resource was detached from.
planNoPlan the resource runs on. Absent for a resource created from environment variables.
stateYesdetached 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.
reasonNoWhy 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_varsNoNames of the environment variables the detach removed from the app. Never their values.
providerNoProvider the resource was provisioned from. Absent for a resource created from environment variables.
resourceYesName of the resource detached, which stays in the organization. Pass it to destroy_resource to delete it.
redactionsYesHow 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_idNoID of the resource. Absent when the call stopped before it found or created one.
kept_env_varsNoNames of variables a detach left on the app because their values are not the ones the resource set. Absent when it kept none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / redactions
      Added value: +{
      +  "description": "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.",
      +  "type": "integer"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "org",
      -  "name",
      -  "resource",
      -  "state"
      -]New value: +[
      +  "org",
      +  "name",
      +  "resource",
      +  "state",
      +  "redactions"
      +]
  2. Changed10 schema fields changed
    • changedOutput schema / properties / env_vars / description
      Previous value: -"Names of the environment variables the attachment sets on the app, or a detach removed from it. Never their values."New value: +"Names of the environment variables the detach removed from the app. Never their values."
    • changedOutput schema / properties / name / description
      Previous value: -"Name of the app the resource is attached to, or was detached from."New value: +"Name of the app the resource was detached from."
    • removedOutput schema / properties / plain_vars_not_set
      Removed value: -{
      -  "description": "Names of the plain_vars this call left unset because it did not attach the resource. Pass them again on the call that attaches.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": [
      -    "null",
      -    "array"
      -  ]
      -}
    • removedOutput schema / properties / plain_vars_set
      Removed value: -{
      -  "description": "Names of the plain_vars this call set on the app, in the restart the attach requested.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": [
      -    "null",
      -    "array"
      -  ]
      -}
    • removedOutput schema / properties / replaced_resource_id
      Removed value: -{
      -  "description": "ID of a destroyed resource that held this name before this call provisioned a new one under it. Absent when the call replaced nothing.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / request
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "The request a person completes in the dashboard to enter a value that must not pass through this conversation. Absent when nothing needs a person.",
      -  "properties": {
      -    "expires_at": {
      -      "description": "When the request expires unanswered, as an RFC 3339 UTC time.",
      -      "type": "string"
      -    },
      -    "fields": {
      -      "description": "Names of what the person enters, never values.",
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": [
      -        "null",
      -        "array"
      -      ]
      -    },
      -    "id": {
      -      "description": "Id of the request. Pass it to get_request to follow the request.",
      -      "type": "string"
      -    },
      -    "next_step": {
      -      "description": "What to do next: give the person the url, then follow the request with get_request.",
      -      "type": "string"
      -    },
      -    "url": {
      -      "description": "Dashboard page to give the person. They open it signed in to Valet to complete the request. It holds no credential.",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "id",
      -    "url",
      -    "expires_at",
      -    "fields",
      -    "next_step"
      -  ],
      -  "type": [
      -    "null",
      -    "object"
      -  ]
      -}
    • changedOutput schema / properties / resource / description
      Previous value: -"Name of the resource in the organization. Pass it as resource to attach_resource, detach_resource, or destroy_resource."New value: +"Name of the resource detached, which stays in the organization. Pass it to destroy_resource to delete it."
    • removedOutput schema / properties / secret_names_not_requested
      Removed value: -{
      -  "description": "Names of the secret_names this call requested no value for because it did not attach the resource. Pass them again on the call that attaches.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": [
      -    "null",
      -    "array"
      -  ]
      -}
    • changedOutput schema / properties / state / description
      Previous value: -"Where the resource or its attachment stands. provisioning: the provider is still creating the resource, so call attach_resource again. attached, attaching, conflicted, detaching, or detached: the state of the attachment to the app, with reason saying why when it is not attached or detached. failed: provisioning failed, and reason says why. deprovisioning or deprovisioned: the resource is being or has been removed."New value: +"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."
    • addedOutput schema / properties / state / enum
      Added value: +[
      +  "detached",
      +  "detaching"
      +]
  3. Changed1 schema field changed
    • changedInput schema / properties / name / description
      Previous value: -"The app's name."New value: +"The app's name, as list_services shows it: the app to detach the resource from."
  4. Changed22 schema fields changed
    • changedInput schema / properties / name / description
      Previous value: -"Required. The app's name."New value: +"The app's name."
    • changedInput schema / properties / resource / description
      Previous value: -"Required. The resource's name in the organization."New value: +"The resource's name in the organization."
    • addedOutput schema / properties / env_vars / description
      Added value: +"Names of the environment variables the attachment sets on the app, or a detach removed from it. Never their values."
    • addedOutput schema / properties / kept_env_vars / description
      Added value: +"Names of variables a detach left on the app because their values are not the ones the resource set. Absent when it kept none."
    • addedOutput schema / properties / name / description
      Added value: +"Name of the app the resource is attached to, or was detached from."
    • addedOutput schema / properties / org / description
      Added value: +"Name of the Valet organization the call acted in."
    • addedOutput schema / properties / plain_vars_not_set / description
      Added value: +"Names of the plain_vars this call left unset because it did not attach the resource. Pass them again on the call that attaches."
    • addedOutput schema / properties / plain_vars_set / description
      Added value: +"Names of the plain_vars this call set on the app, in the restart the attach requested."
    • addedOutput schema / properties / plan / description
      Added value: +"Plan the resource runs on. Absent for a resource created from environment variables."
    • addedOutput schema / properties / provider / description
      Added value: +"Provider the resource was provisioned from. Absent for a resource created from environment variables."
    • addedOutput schema / properties / reason / description
      Added value: +"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."
    • addedOutput schema / properties / replaced_resource_id / description
      Added value: +"ID of a destroyed resource that held this name before this call provisioned a new one under it. Absent when the call replaced nothing."
    • addedOutput schema / properties / request / description
      Added value: +"The request a person completes in the dashboard to enter a value that must not pass through this conversation. Absent when nothing needs a person."
    • addedOutput schema / properties / request / properties / expires_at / description
      Added value: +"When the request expires unanswered, as an RFC 3339 UTC time."
    • addedOutput schema / properties / request / properties / fields / description
      Added value: +"Names of what the person enters, never values."
    • addedOutput schema / properties / request / properties / id / description
      Added value: +"Id of the request. Pass it to get_request to follow the request."
    • addedOutput schema / properties / request / properties / next_step / description
      Added value: +"What to do next: give the person the url, then follow the request with get_request."
    • addedOutput schema / properties / request / properties / url / description
      Added value: +"Dashboard page to give the person. They open it signed in to Valet to complete the request. It holds no credential."
    • addedOutput schema / properties / resource / description
      Added value: +"Name of the resource in the organization. Pass it as resource to attach_resource, detach_resource, or destroy_resource."
    • addedOutput schema / properties / resource_id / description
      Added value: +"ID of the resource. Absent when the call stopped before it found or created one."
    • addedOutput schema / properties / secret_names_not_requested / description
      Added value: +"Names of the secret_names this call requested no value for because it did not attach the resource. Pass them again on the call that attaches."
    • addedOutput schema / properties / state / description
      Added value: +"Where the resource or its attachment stands. provisioning: the provider is still creating the resource, so call attach_resource again. attached, attaching, conflicted, detaching, or detached: the state of the attachment to the app, with reason saying why when it is not attached or detached. failed: provisioning failed, and reason says why. deprovisioning or deprovisioned: the resource is being or has been removed."
  5. Changed7 schema fields changed
    • addedOutput schema / properties / plain_vars_not_set
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • addedOutput schema / properties / plain_vars_set
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • addedOutput schema / properties / request
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "expires_at": {
      +      "type": "string"
      +    },
      +    "fields": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "next_step": {
      +      "type": "string"
      +    },
      +    "url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "url",
      +    "expires_at",
      +    "fields",
      +    "next_step"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
    • addedOutput schema / properties / secret_names_not_requested
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • removedOutput schema / properties / vars_kind
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / vars_not_set
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": [
      -    "null",
      -    "array"
      -  ]
      -}
    • removedOutput schema / properties / vars_set
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": [
      -    "null",
      -    "array"
      -  ]
      -}
  6. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "env_vars": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "kept_env_vars": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "org": {
      +      "type": "string"
      +    },
      +    "plan": {
      +      "type": "string"
      +    },
      +    "provider": {
      +      "type": "string"
      +    },
      +    "reason": {
      +      "type": "string"
      +    },
      +    "replaced_resource_id": {
      +      "type": "string"
      +    },
      +    "resource": {
      +      "type": "string"
      +    },
      +    "resource_id": {
      +      "type": "string"
      +    },
      +    "state": {
      +      "type": "string"
      +    },
      +    "vars_kind": {
      +      "type": "string"
      +    },
      +    "vars_not_set": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "vars_set": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "org",
      +    "name",
      +    "resource",
      +    "state"
      +  ],
      +  "type": "object"
      +}
  7. Added

TDQS

A3.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it explains exactly what is destroyed (environment variables, not the resource or its data), that other apps keep the resource, that a running process retains the variables until replaced, that partially-mismatched values remain and are named, and that redaction of secrets is best-effort. None of that is recoverable from destructiveHint=true alone.

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

Conciseness3/5

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

Purpose is front-loaded, but the sentence about Valet still owing the restart or removal is syntactically tangled and hard to parse, and the redaction paragraph is dense. Much of the content earns its place; the phrasing does not.

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?

For a destructive mutation it covers side effects, partial-failure state, credential requirement, and even answer content, and an output schema exists for return details. The only gap is that the retry/pending-state behavior is described in a way that is difficult to action on.

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 name, org_name, and resource are already documented in the schema. The description adds no new meaning about these parameters (no format, no default behavior for org_name), so baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource: detach a resource from an app, and immediately scopes the effect (removing the environment variables it set, requesting a restart). It never names the sibling attach_resource explicitly, so differentiation is inferred rather than stated.

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?

Usage is implied by the name and by the note that detaching an unattached resource changes nothing, but there is no explicit when-to-use vs. attach_resource/destroy_resource guidance or stated prerequisites beyond the account requirement.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources