Skip to main content
Glama

local_dev_cleanup

Remove temporary files and reset configurations in local development environments to maintain system performance and prepare for new projects.

Instructions

Clean up a local development environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
env_idYesEnvironment identifier

Implementation Reference

  • Registers the local_dev_cleanup tool with MCP framework, defining name, description, and input schema requiring 'env_id'.
    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"], }, ), ]
  • Implements the tool handler: retrieves environment by ID, calls cleanup_environment if found, returns JSON success/error response.
    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" }, } ), ) ]
  • Core cleanup logic: removes environment from in-memory store and invokes sandbox cleanup.
    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)
  • Retrieves environment from in-memory store by ID, used in handler.
    def get_environment(env_id: str) -> Optional[Environment]: """Get environment by ID.""" return _ENVIRONMENTS.get(env_id)

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