Skip to main content
Glama

Delete stopped environments

gitlab_delete_stopped_environments
DestructiveIdempotent

Delete stopped review app environments for a GitLab project to remove inactive deployments and reclaim resources.

Instructions

Delete stopped environments (review apps) for a project.

Args: **kwargs: Additional parameters for the request (e.g., project_id).

Returns: Response: A wrapper containing the original response (no data for successful deletion).

Raises: MissingParameterError: If the project_id is missing. ParameterError: If invalid parameters are provided.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gitlab_delete_stopped_environments"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNo
keyNo
refNo
cronNo
dataNo
nameNo
pageNo
pathNo
sortNo
tierNo
forceNo
limitNo
ownedNo
topicNo
valueNo
activeNo
avatarNo
beforeNo
mirrorNo
searchNo
simpleNo
statesNo
topicsNo
confirmNoExplicitly confirm this destructive operation. Needed only when the client cannot answer a confirmation prompt.
dry_runNo
starredNo
archivedNo
group_idNo
id_afterNo
importedNo
order_byNo
per_pageNo
tag_listNo
tag_nameNo
topic_idNo
id_beforeNo
max_pagesNo
expires_atNo
import_urlNo
membershipNo
project_idNo
statisticsNo
visibilityNo
descriptionNo
lfs_enabledNo
total_pagesNo
external_urlNo
group_accessNo
merge_methodNo
build_timeoutNo
cron_timezoneNo
public_buildsNo
squash_optionNo
variable_typeNo
approval_rulesNo
ci_config_pathNo
default_branchNo
environment_idNo
include_hiddenNo
mirror_user_idNo
emails_disabledNo
issues_templateNo
cluster_agent_idNo
environment_nameNo
min_access_levelNo
packages_enabledNo
allowed_to_createNo
auto_stop_settingNo
search_namespacesNo
wiki_access_levelNo
build_git_strategyNo
flux_resource_pathNo
pages_access_levelNo
repository_storageNo
auto_devops_enabledNo
builds_access_levelNo
ci_separated_cachesNo
create_access_levelNo
issues_access_levelNo
ci_default_git_depthNo
deploy_access_levelsNo
forking_access_levelNo
keep_latest_artifactNo
kubernetes_namespaceNo
merge_trains_enabledNo
pipeline_schedule_idNo
service_desk_enabledNo
merge_commit_templateNo
mirror_trigger_buildsNo
releases_access_levelNo
snippets_access_levelNo
analytics_access_levelNo
approvals_before_mergeNo
include_pending_deleteNo
mr_default_target_selfNo
request_access_enabledNo
shared_runners_enabledNo
squash_commit_templateNo
merge_pipelines_enabledNo
merge_requests_templateNo
operations_access_levelNo
repository_access_levelNo
requirements_access_levelNo
suggestion_commit_messageNo
repository_checksum_failedNo
auto_devops_deploy_strategyNo
autoclose_referenced_issuesNo
merge_requests_access_levelNo
auto_cancel_pending_pipelinesNo
ci_forward_deployment_enabledNo
enforce_auth_checks_on_uploadsNo
only_mirror_protected_branchesNo
allow_merge_on_skipped_pipelineNo
container_registry_access_levelNo
restrict_user_defined_variablesNo
remove_source_branch_after_mergeNo
resolve_outdated_diff_discussionsNo
mirror_overwrites_diverged_branchesNo
printing_merge_request_link_enabledNo
security_and_compliance_access_levelNo
only_allow_merge_if_pipeline_succeedsNo
container_expiration_policy_attributesNo
external_authorization_classification_labelNo
only_allow_merge_if_all_status_checks_passedNo
ci_allow_fork_pipelines_to_run_in_parent_projectNo
only_allow_merge_if_all_discussions_are_resolvedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv27.3.20
    • changedInput schema / properties / active / default
      Previous value: -trueNew value: +null
    • removedInput schema / properties / api_parameters
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null
      -}
    • removedInput schema / properties / import_url / anyOf
      Removed value: -[
      -  {
      -    "format": "uri",
      -    "maxLength": 2083,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / import_url / title
      Added value: +"Import Url"
  2. Changed1 schema field changedv27.3.18
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "description": "Explicitly confirm this destructive operation. Needed only when the client cannot answer a confirmation prompt.",
      +  "type": "boolean"
      +}
  3. First observedv27.3.13

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and openWorldHint=true, so the safety profile is covered externally. The description adds that successful deletion returns no data and lists MissingParameterError/ParameterError handling, but it does not explain the actual deletion scope, confirmation behavior, or how dry_run affects execution.

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?

The purpose is front-loaded and the note about no data on successful deletion is useful. However, the 'Args: **kwargs' section is boilerplate and misleading given the actual schema exposes many named parameters, and the docstring structure adds little practical navigation value.

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

Completeness2/5

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

For a destructive bulk-deletion tool with 126 parameters and near-zero schema coverage, the description is far too sparse. It covers basic purpose, return, and two errors, but leaves the agent unable to determine which parameters are relevant or how deletion scope is constrained.

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

Parameters2/5

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

Schema description coverage is only 1% across 126 mostly generic parameters. The description mentions **kwargs and gives project_id as an example, plus the error if project_id is missing, which is useful but far too thin. It does not explain the roles of environment_id, id, name, confirm, dry_run, or why so many unrelated parameters exist.

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?

The first sentence gives a specific verb and resource: 'Delete stopped environments (review apps) for a project.' It clearly identifies the operation and scope. It does not explicitly distinguish this from sibling tools such as gitlab_delete_environment, gitlab_stop_environment, or gitlab_stop_stale_environments.

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 description implies the tool is for cleaning up stopped review-app environments in a project, and the Raises section implies project_id is required. However, it gives no explicit guidance on when to use this versus stop_environment, delete_environment, or stop_stale_environments, nor any exclusions.

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

Deploy Server

Other Tools