app_create
Create a new web application directory with starter files for development. Set up your app structure and customize content while keeping essential API utilities.
Instructions
Create a new web application directory and copy starter files.
The starter files are for you to replace with actual content, you don't have to use them as is.
the goose_api.js file is a utility you will want to keep in case you need to do api calls as part of your app via goose.
Args:
app_name: Name of the application (will be used as directory name)
description: Brief description of the application (default: "")
Returns:
A dictionary containing the result of the operation
After this, consider how you want to change the app to meet the functionality, look at the examples in resources dir if you like.
Or, you can replace the content with existing html/css/js files you have (just make sure to leave the goose_api.js file in the app dir)
Use the app_error tool once it is opened and user has interacted (or has started) to check for errors you can correct the first time, this is important to know it works.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_name | Yes | ||
| description | No |
Implementation Reference
- main.py:197-266 (handler)The core handler function for the 'app_create' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. Creates a new application directory, copies starter files from resources/kitchen-sink, generates a manifest.json, handles naming sanitization and errors.@mcp.tool() def app_create(app_name: str, description: str = "") -> Dict[str, Any]: """ Create a new web application directory and copy starter files. The starter files are for you to replace with actual content, you don't have to use them as is. the goose_api.js file is a utility you will want to keep in case you need to do api calls as part of your app via goose. Args: app_name: Name of the application (will be used as directory name) description: Brief description of the application (default: "") Returns: A dictionary containing the result of the operation After this, consider how you want to change the app to meet the functionality, look at the examples in resources dir if you like. Or, you can replace the content with existing html/css/js files you have (just make sure to leave the goose_api.js file in the app dir) Use the app_error tool once it is opened and user has interacted (or has started) to check for errors you can correct the first time, this is important to know it works. """ global http_server, server_port if http_server: return "There is already a server running. Please stop it before creating a new app, or consider if an existing app should be modified instead." try: # Sanitize app name (replace spaces with hyphens, remove special characters) safe_app_name = "".join(c if c.isalnum() else "-" for c in app_name).lower() # Create app directory app_path = os.path.join(APP_DIR, safe_app_name) if os.path.exists(app_path): return { "success": False, "error": f"App '{safe_app_name}' already exists at {app_path}" } os.makedirs(app_path, exist_ok=True) # Copy kitchen-sink template files kitchen_sink_dir = os.path.join(RESOURCES_DIR, "kitchen-sink") copied_files = ["index.html", "style.css", "script.js", "goose_api.js"] for file_name in copied_files: src_file = os.path.join(kitchen_sink_dir, file_name) dest_file = os.path.join(app_path, file_name) shutil.copy2(src_file, dest_file) # Create manifest file manifest = { "name": app_name, "description": description, "created": time.strftime("%Y-%m-%d %H:%M:%S"), "files": copied_files } with open(os.path.join(app_path, "goose-app-manifest.json"), 'w') as f: json.dump(manifest, f, indent=2) return { "success": True, "app_name": safe_app_name, "app_path": app_path, "files": copied_files, "message": f"App '{app_name}' created successfully at {app_path}" } except Exception as e: logger.error(f"Error creating app: {e}") return {"success": False, "error": f"Failed to create app: {str(e)}"}
- main.py:99-99 (registration)Mention of the 'app_create' tool in the system instructions provided to the MCP server, listing available tools for the AI model.app_create - use this when starting new
- main.py:198-207 (schema)Function signature and docstring defining the input schema (parameters: app_name (str, required), description (str, optional)) and output type (Dict[str, Any]) for the app_create tool.def app_create(app_name: str, description: str = "") -> Dict[str, Any]: """ Create a new web application directory and copy starter files. The starter files are for you to replace with actual content, you don't have to use them as is. the goose_api.js file is a utility you will want to keep in case you need to do api calls as part of your app via goose. Args: app_name: Name of the application (will be used as directory name) description: Brief description of the application (default: "")