Skip to main content
Glama

stage_create_scene

Initialize a new 3D scene workspace for composition, containing objects, lighting, camera shots, and physics bindings to create animations and render videos.

Instructions

Create a new 3D scene for composition.

Initializes a new scene workspace backed by chuk-artifacts.
The scene can contain 3D objects, lighting, camera shots, and physics bindings.

Args:
    name: Optional scene name (e.g., "pendulum-demo", "f1-silverstone-t1")
    author: Optional author name for metadata
    description: Optional scene description

Returns:
    CreateSceneResponse with scene_id and success message

Tips for LLMs:
    - Scene ID is auto-generated (UUID)
    - Scenes are stored in USER scope (Google Drive) if authenticated, SESSION scope otherwise
    - Use the scene_id for all subsequent operations
    - Typical workflow: create_scene → add_objects → add_shots → export

Example:
    scene = await stage_create_scene(
        name="falling-ball-demo",
        author="Claude",
        description="Simple gravity demonstration"
    )
    # Use scene.scene_id for next steps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
authorNo
descriptionNo
_user_idNo

Implementation Reference

  • Main implementation of stage_create_scene tool. Handles creating a new 3D scene with UUID generation, authentication-based storage scope selection (USER for authenticated users, SESSION otherwise), and returns CreateSceneResponse with scene_id.
    @requires_auth()
    @tool  # type: ignore[arg-type]
    async def stage_create_scene(
        name: Optional[str] = None,
        author: Optional[str] = None,
        description: Optional[str] = None,
        _external_access_token: Optional[str] = None,  # Injected by OAuth middleware
        _user_id: Optional[str] = None,  # Injected by OAuth middleware
    ) -> CreateSceneResponse:
        """Create a new 3D scene for composition.
    
        Initializes a new scene workspace backed by chuk-artifacts.
        The scene can contain 3D objects, lighting, camera shots, and physics bindings.
    
        Args:
            name: Optional scene name (e.g., "pendulum-demo", "f1-silverstone-t1")
            author: Optional author name for metadata
            description: Optional scene description
    
        Returns:
            CreateSceneResponse with scene_id and success message
    
        Tips for LLMs:
            - Scene ID is auto-generated (UUID)
            - Scenes are stored in USER scope (Google Drive) if authenticated, SESSION scope otherwise
            - Use the scene_id for all subsequent operations
            - Typical workflow: create_scene → add_objects → add_shots → export
    
        Example:
            scene = await stage_create_scene(
                name="falling-ball-demo",
                author="Claude",
                description="Simple gravity demonstration"
            )
            # Use scene.scene_id for next steps
        """
        from chuk_artifacts import StorageScope
        from chuk_mcp_server import get_user_id
    
        from .models import SceneMetadata
    
        manager = get_scene_manager()
    
        # Generate scene ID
        import uuid
    
        scene_id = f"scene-{uuid.uuid4().hex[:8]}"
    
        # Create metadata
        metadata = SceneMetadata(author=author, description=description)
    
        # Determine storage scope and user_id based on authentication
        user_id = get_user_id()
        if user_id:
            # User is authenticated via OAuth - store in USER scope (Google Drive)
            scope = StorageScope.USER
            logger.info(f"Creating scene in USER scope for user {user_id}")
        else:
            # No authentication - use SESSION scope (ephemeral)
            scope = StorageScope.SESSION
            logger.info("Creating scene in SESSION scope (no user authentication)")
    
        # Create scene
        scene = await manager.create_scene(
            scene_id=scene_id, name=name, metadata=metadata, scope=scope, user_id=user_id
        )
    
        return CreateSceneResponse(scene_id=scene.id, message=f"Scene '{name or scene_id}' created")
  • CreateSceneResponse model - defines the return type for stage_create_scene tool with scene_id and message fields.
    class CreateSceneResponse(BaseModel):
        """Response from creating a scene."""
    
        scene_id: str
        message: str = "Scene created successfully"
  • SceneMetadata model - defines optional metadata fields (author, created, description, tags) for scenes.
    class SceneMetadata(BaseModel):
        """Scene metadata."""
    
        author: Optional[str] = None
        created: Optional[str] = None
        description: Optional[str] = None
        tags: list[str] = Field(default_factory=list)
  • SceneManager.create_scene method - core helper that creates workspace namespace via chuk-artifacts, instantiates Scene object, persists to storage, and caches in memory.
    async def create_scene(
        self,
        scene_id: str,
        name: Optional[str] = None,
        metadata: Optional[SceneMetadata] = None,
        scope: StorageScope = StorageScope.SESSION,
        user_id: Optional[str] = None,
    ) -> Scene:
        """Create a new scene.
    
        Args:
            scene_id: Unique scene identifier
            name: Optional scene name
            metadata: Optional scene metadata
            scope: Storage scope (SESSION, USER, or SANDBOX)
            user_id: User ID (required for USER scope)
    
        Returns:
            Created Scene object
        """
        logger.info(f"Creating scene: {scene_id}")
    
        # Create workspace namespace for this scene
        namespace = await self._store.create_namespace(
            type=NamespaceType.WORKSPACE,
            name=name or scene_id,
            scope=scope,
            user_id=user_id,
        )
    
        # Create scene object
        scene = Scene(
            id=scene_id,
            name=name,
            metadata=metadata or SceneMetadata(),
        )
    
        # Save to storage
        await self._save_scene(scene, namespace.namespace_id)
    
        # Cache
        self._scenes[scene_id] = scene
        self._scene_to_namespace[scene_id] = namespace.namespace_id
    
        logger.info(f"Scene created: {scene_id} -> namespace {namespace.namespace_id}")
        return scene
  • Tool registration using @requires_auth() and @tool decorators that register stage_create_scene as an MCP tool endpoint.
    @requires_auth()
    @tool  # type: ignore[arg-type]
Behavior4/5

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

With no annotations provided, the description carries full burden and delivers substantial behavioral context. It explains that scene IDs are auto-generated UUIDs, describes storage scope differences (USER vs SESSION based on authentication), and outlines the typical multi-step workflow. It doesn't mention rate limits, error conditions, or authentication requirements, keeping it from a perfect score.

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

Conciseness5/5

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

The description is efficiently structured with clear sections: purpose statement, initialization details, Args/Returns documentation, LLM-specific tips, and a practical example. Every sentence adds value - there's no redundant or vague language, and the information is front-loaded with the core functionality.

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 creation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description provides strong context about the tool's behavior, workflow integration, and parameter usage. The main gap is the undocumented '_user_id' parameter and lack of error/edge case information, but overall it gives the agent sufficient guidance to use the tool effectively.

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

Parameters4/5

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

With 0% schema description coverage for 4 parameters, the description compensates well by documenting 3 parameters (name, author, description) with examples and clarifying they're optional. However, it omits the '_user_id' parameter entirely, leaving one parameter undocumented. The examples and formatting guidance add meaningful value beyond basic parameter listing.

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

Purpose5/5

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

The description clearly states the specific action ('Create a new 3D scene'), the resource ('scene workspace backed by chuk-artifacts'), and the composition elements it can contain (3D objects, lighting, camera shots, physics bindings). It distinguishes this creation tool from sibling tools like stage_add_object or stage_export_scene by focusing on initial scene setup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'Typical workflow: create_scene → add_objects → add_shots → export' directly names the sequence and alternative tools for subsequent operations. The 'Tips for LLMs' section further clarifies the tool's role in the workflow and when to use the returned scene_id.

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

Install Server

Other 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/chrishayuk/chuk-mcp-stage'

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