delete_version_series
Deletes all versions of a document by specifying its version series ID, removing the entire version series from the content repository.
Instructions
Deletes an entire version series (all versions of a document) in the content repository.
:param version_series_id: The version series ID (GUID) to delete. If you don't have the version series ID, first call get_document_property on the document to get the version series ID.
:returns: If successful, returns the deleted version series ID as a string. If unsuccessful, returns a ToolError with details about the failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version_series_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The actual handler function that implements the delete_version_series tool. It sends a GraphQL mutation deleteVersionSeries and returns the deleted version series ID.
@mcp.tool( name="delete_version_series", annotations=ToolAnnotations(destructiveHint=True) ) async def delete_version_series( version_series_id: str, ) -> Union[str, ToolError]: """ Deletes an entire version series (all versions of a document) in the content repository. :param version_series_id: The version series ID (GUID) to delete. If you don't have the version series ID, first call get_document_property on the document to get the version series ID. :returns: If successful, returns the deleted version series ID as a string. If unsuccessful, returns a ToolError with details about the failure. """ method_name = "delete_version_series" try: # Prepare the mutation to delete the version series mutation = """ mutation ($object_store_name: String!, $identifier: String!) { deleteVersionSeries( repositoryIdentifier: $object_store_name identifier: $identifier ) { id className } } """ # Prepare variables for the GraphQL mutation variables = { "object_store_name": graphql_client.object_store, "identifier": version_series_id, } # Execute the GraphQL mutation logger.info("Executing version series deletion") response: Union[ToolError, Dict[str, Any]] = ( await graphql_client_execute_async_wrapper( logger, method_name, graphql_client, query=mutation, variables=variables, ) ) if isinstance(response, ToolError): return response # Return just the id as a string return response["data"]["deleteVersionSeries"]["id"] except Exception as e: logger.error("%s failed: %s", method_name, str(e)) logger.error(traceback.format_exc()) return ToolError( message=f"{method_name} failed: {str(e)}. Trace available in server logs." ) - src/cs_mcp_server/tools/documents.py:775-777 (registration)The tool is registered as an MCP tool via the @mcp.tool decorator with name 'delete_version_series' and a destructive hint annotation. It is registered inside the register_document_tools function.
@mcp.tool( name="delete_version_series", annotations=ToolAnnotations(destructiveHint=True) )