open_project
Open a specific DaVinci Resolve project by entering its name, enabling direct project selection without manual browsing.
Instructions
Open a project by name
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the project to open |
Implementation Reference
- The actual implementation of the open_project tool. It connects to DaVinci Resolve's project manager, checks if the project exists, loads it via LoadProject(), and updates the current project reference.
def open_project(self, name: str) -> bool: """Open a project by name.""" self._ensure_connected() if not self._project_manager: return False # Check if project exists projects = self.list_projects() if name not in projects: raise ValueError( f"Project '{name}' not found. Available: {', '.join(projects)}" ) result = self._project_manager.LoadProject(name) if result: self._current_project = self._project_manager.GetCurrentProject() logger.info(f"Opened project: {name}") return bool(result) - The schema/definition of the open_project tool, defining it as an MCP Tool with name 'open_project', description, and input schema requiring a 'name' string parameter.
types.Tool( name="open_project", description="Open a project by name", inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "The name of the project to open", } }, "required": ["name"], }, ), - src/davinci_mcp/server.py:99-106 (registration)The dispatch routing in the MCP server's _call_tool method that maps the 'open_project' name string to the resolve_client.open_project() call and formats the response.
elif name == "open_project": name_arg = arguments.get("name", "") result = self.resolve_client.open_project(name_arg) return ( f"Successfully opened project '{name_arg}'" if result else f"Failed to open project '{name_arg}'" ) - src/davinci_mcp/server.py:38-48 (registration)The server handler registration that wires up the call_tool handler which ultimately dispatches to _call_tool.
def _register_handlers(self) -> None: """Register MCP server handlers.""" @self.server.list_tools() async def handle_list_tools() -> list[types.Tool]: # type: ignore[reportUnusedFunction] return get_all_tools() @self.server.call_tool() async def handle_call_tool( # type: ignore[reportUnusedFunction] name: str, arguments: dict[str, Any] | None = None ) -> list[types.TextContent]: