Skip to main content
Glama

local_dev_cleanup

Remove unused files and data from a local development environment to free up space and maintain organization. Supports cleaning by specifying an environment identifier.

Instructions

Clean up a local development environment

Input Schema

NameRequiredDescriptionDefault
env_idYesEnvironment identifier

Input Schema (JSON Schema)

{ "properties": { "env_id": { "description": "Environment identifier", "type": "string" } }, "required": [ "env_id" ], "type": "object" }

Implementation Reference

  • Dispatch handler for the local_dev_cleanup tool. Retrieves the environment by ID using get_environment, calls cleanup_environment(env) if exists, otherwise returns error response. Returns JSON-formatted success message.
    elif name == "local_dev_cleanup": env = get_environment(arguments["env_id"]) if not env: return [ types.TextContent( type="text", text=json.dumps( { "success": False, "error": f"Unknown environment: {arguments['env_id']}", } ), ) ] cleanup_environment(env) return [ types.TextContent( type="text", text=json.dumps( { "success": True, "data": { "message": "Environment cleaned up successfully" }, } ), ) ]
  • Input schema definition for the local_dev_cleanup tool, requiring 'env_id' string.
    types.Tool( name="local_dev_cleanup", description="Clean up a local development environment", inputSchema={ "type": "object", "properties": { "env_id": {"type": "string", "description": "Environment identifier"} }, "required": ["env_id"], }, ),
  • Registration of tools list via MCP Server's list_tools handler, which returns the tools array including local_dev_cleanup.
    @server.list_tools() async def list_tools() -> List[types.Tool]: logger.debug("Tools requested") return tools
  • Helper function implementing the core cleanup logic: removes environment from in-memory store and cleans up the sandbox.
    def cleanup_environment(env: Environment) -> None: """Clean up environment and its resources.""" if env.id in _ENVIRONMENTS: del _ENVIRONMENTS[env.id] cleanup_sandbox(env.sandbox)

Other Tools

Related 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/txbm/mcp-local-dev'

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