get_removal_info
Check the status and retrieve details of a subtitle removal task, including progress stage and result URL when available.
Instructions
[AllVoiceLab Tool] Retrieve status and details of a subtitle removal task.
This tool queries the current status of a previously submitted subtitle removal task and returns detailed information
about its progress, including the current processing stage, completion status, and result URL if available.
Args:
project_id: The unique identifier of the subtitle removal task to check. This ID is returned from the remove_subtitle tool. Required.
Returns:
TextContent containing the status (e.g., "pending", "processing", "success", "failed") and other details of the subtitle removal task,
including the URL to the processed video if the task has completed successfully.
Limitations:
- The project_id must be valid and properly formatted
- The task must have been previously submitted to the AllVoiceLab API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Implementation Reference
- allvoicelab_mcp/tools/dubbing.py:486-542 (handler)The handler function that executes the get_removal_info tool. It validates the project_id, fetches the removal information using the AllVoiceLab client, formats the response details into a text message, and returns it as TextContent.def get_removal_info(project_id: str) -> TextContent: """ Retrieve status and details of a subtitle removal task Args: project_id: The unique identifier of the subtitle removal task to check. This ID is returned from the remove_subtitle tool. Required. Returns: TextContent: Text content containing the status (e.g., "pending", "processing", "success", "failed") and other details of the subtitle removal task, including the URL to the processed video if the task has completed successfully. """ all_voice_lab = get_client() logging.info(f"Tool called: get_removal_info") logging.info(f"Project ID: {project_id}") # Validate parameters if not project_id: logging.warning("Project ID parameter is empty") return TextContent( type="text", text="project_id parameter cannot be empty" ) try: logging.info("Getting subtitle removal task information") removal_info = all_voice_lab.get_removal_info(project_id) logging.info(f"Subtitle removal info retrieved successfully for ID: {project_id}") # Format the result buffer = [] buffer.append(f"Project ID: {removal_info.project_id}\n") buffer.append(f"Status: {removal_info.status}\n") if removal_info.name: buffer.append(f"Project Name: {removal_info.name}\n") if removal_info.output_url and removal_info.status == "done": buffer.append(f"Output URL: {removal_info.output_url}\n") buffer.append( f"The subtitle removal task has been completed. You can download the processed video from the output URL.\n") else: buffer.append( f"The subtitle removal task is still in progress. Please check again later using the project ID.\n") # Join the list into a string result = "".join(buffer) return TextContent( type="text", text=result ) except Exception as e: logging.error(f"Failed to get subtitle removal information: {str(e)}") return TextContent( type="text", text=f"Failed to get subtitle removal information, tool temporarily unavailable" )
- allvoicelab_mcp/server.py:243-261 (registration)MCP tool registration for 'get_removal_info', specifying the name, detailed description including args and returns (serving as schema), and binding the handler function from dubbing.py.mcp.tool( name="get_removal_info", description="""[AllVoiceLab Tool] Retrieve status and details of a subtitle removal task. This tool queries the current status of a previously submitted subtitle removal task and returns detailed information about its progress, including the current processing stage, completion status, and result URL if available. Args: project_id: The unique identifier of the subtitle removal task to check. This ID is returned from the remove_subtitle tool. Required. Returns: TextContent containing the status (e.g., "pending", "processing", "success", "failed") and other details of the subtitle removal task, including the URL to the processed video if the task has completed successfully. Limitations: - The project_id must be valid and properly formatted - The task must have been previously submitted to the AllVoiceLab API """ )(get_removal_info)
- client/all_voice_lab.py:570-602 (helper)Underlying API client method called by the tool handler to fetch removal information from the AllVoiceLab API and parse it into a RemovalInfoResponse object.def get_removal_info(self, project_id: str) -> RemovalInfoResponse: """ Query the result of subtitle removal Args: project_id: Subtitle removal project ID Returns: Subtitle removal project information response object Raises: Exception: When the request fails """ # Create HTTP request url = f"{self.api_domain}/v1/videotrans/removal?project_id={project_id}" # Send request response = requests.get(url, headers=self._get_headers(), timeout=30) logging.info(f"get_removal_info response: {response.headers}") # Check status code if response.status_code != 200: logging.error(f"get_removal_info Request failed, status code: {response.status_code}") raise Exception(f"get_removal_info Request failed, status code: {response.status_code}") # Read response content response_data = response.text logging.info(response_data) # Parse JSON response json_data = json.loads(response_data) resp = RemovalInfoResponse.from_dict(json_data) return resp