Skip to main content
Glama
ibm-ecm

IBM Core Content Services MCP Server

Official
by ibm-ecm

delete_version_series

Destructive

Delete all versions of a document in the content repository by providing the version series ID.

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

TableJSON Schema
NameRequiredDescriptionDefault
version_series_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler function for 'delete_version_series'. It receives a version_series_id parameter, performs a GraphQL mutation (deleteVersionSeries) to delete the entire version series, and returns the deleted ID or a ToolError on failure.
    @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."
            )
  • The registration function register_server_tools shows that register_document_tools (which contains delete_version_series) is called for CORE and FULL server types.
    def register_server_tools(
        graphql_client: GraphQLClient,
        metadata_cache: MetadataCache,
        server_type: ServerType,
    ) -> None:
        """
        Register tools based on the server type.
    
        Args:
            graphql_client: The initialized GraphQL client
            metadata_cache: The metadata cache instance
            server_type: The type of server (ServerType enum)
        """
        # Ensure mcp is initialized (type narrowing for type checker)
        assert mcp is not None
    
        logger.info("Registering tools for %s server", server_type.value)
    
        # Register tools based on server type
        if server_type == ServerType.CORE:
            register_document_tools(mcp, graphql_client, metadata_cache)
            register_folder_tools(mcp, graphql_client)
            register_class_tools(mcp, graphql_client, metadata_cache)
            register_search_tools(mcp, graphql_client, metadata_cache)
            # register_annotation_tools(mcp, graphql_client)
            # register_custom_object_tools(mcp, graphql_client)
            logger.info("Core tools registered")
    
        elif server_type == ServerType.AI__DOCUMENT_INSIGHT:
            register_advanced_search_tools(mcp, graphql_client, metadata_cache)
            register_vector_search_tool(mcp, graphql_client)
            logger.info("AI Document Insight tools registered")
    
        elif server_type == ServerType.LEGAL_HOLD:
            register_hold_tools(mcp, graphql_client)
            logger.info("Legal hold tools registered")
    
        elif server_type == ServerType.PROPERTY_EXTRACTION_AND_CLASSIFICATION:
            register_property_extraction_tools(mcp, graphql_client, metadata_cache)
            register_classification_tools(mcp, graphql_client, metadata_cache)
            logger.info("Property extraction and classification tools registered")
    
        elif server_type == ServerType.FULL:
            register_document_tools(mcp, graphql_client, metadata_cache)
            register_folder_tools(mcp, graphql_client)
            register_class_tools(mcp, graphql_client, metadata_cache)
            register_search_tools(mcp, graphql_client, metadata_cache)
            # register_annotation_tools(mcp, graphql_client)
            # register_custom_object_tools(mcp, graphql_client)
            register_vector_search_tool(mcp, graphql_client)
            register_advanced_search_tools(mcp, graphql_client, metadata_cache)
            register_annotation_tools(mcp, graphql_client)
    
            register_hold_tools(mcp, graphql_client)
            register_property_extraction_tools(mcp, graphql_client, metadata_cache)
            register_classification_tools(mcp, graphql_client, metadata_cache)
            logger.info("All tools registered")
    
        else:
            raise ValueError(f"Unknown server type: {server_type}")
  • The tools __init__.py exports register_document_tools from the documents module, which contains the delete_version_series handler.
    """
    Tools module for MCP servers.
    
    This module exports all tool registration functions from the tools directory.
    """
    
    # Import all registration functions to make them available when importing from this package
    from .classes import register_class_tools
    from .search import register_search_tools
    from .legal_hold import register_hold_tools
    from .vector_search import register_vector_search_tool
    from .property_extraction import register_property_extraction_tools
    from .annotations import register_annotation_tools
    from .documents import register_document_tools
    from .folders import register_folder_tools
    from .custom_objects import register_custom_object_tools
    
    
    # Define __all__ to specify what gets imported with "from tools import *"
    __all__ = [
        "register_class_tools",
        "register_document_tools",
        "register_search_tools",
        "register_hold_tools",
        "register_vector_search_tool",
        "register_property_extraction_tools",
        "register_annotation_tools",
        "register_folder_tools",
        "register_custom_object_tools",
    ]
  • Constant VERSION_SERIES_CLASS used to identify the VersionSeries class type in the system.
    VERSION_SERIES_CLASS = "VersionSeries"
  • The core model defines versionSeries as an optional field on Document objects, which is referenced in the documentation for retrieving version series IDs.
    versionSeries: Optional[dict] = Field(default=None, description="Version series")
Behavior4/5

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

Annotations already mark destructiveHint=true. Description adds context by specifying that it removes all versions and describes return behavior (success returns ID, failure returns ToolError). Does not disclose permissions or reversibility, but adequate given annotations.

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?

Single paragraph with clear first-sentence purpose, followed by parameter and return documentation. No wasted words.

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?

Covers purpose, parameter, and return. Output schema exists but not detailed; description provides sufficient info. Could mention potential prerequisites or side effects, but overall adequate for a simple deletion tool.

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

Parameters5/5

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

Schema has 0% parameter description coverage. The description fully compensates by explaining that version_series_id is a GUID to delete and instructs how to obtain it if unknown, significantly adding meaning beyond the schema.

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?

Clearly states it deletes an entire version series (all versions of a document). Verb 'Deletes' plus resource 'version series' is specific. Distinguishes from sibling 'delete_document_version' which deletes a single version.

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

Usage Guidelines4/5

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

Provides a helpful hint to obtain the version series ID via get_document_property if missing. However, does not explicitly state when to use this tool versus alternatives like delete_document_version, leaving some ambiguity.

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/ibm-ecm/ibm-content-services-mcp-server'

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