Skip to main content
Glama
ibm-ecm

IBM Core Content Services MCP Server

Official
by ibm-ecm

delete_folder

Delete a folder from the content repository by providing its unique identifier or path.

Instructions

Deletes a folder in the content repository. This tool interfaces with the GraphQL API to delete a folder object with the provided id.

:param id_or_path string Yes The unique identifier or path for the folder. If not provided, an error will be returned.

:returns: If successful, return the folder id. Else, return a ToolError instance that describes the error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_or_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The delete_folder tool is registered with FastMCP via the @mcp.tool decorator with name 'delete_folder'. This registration happens inside the register_folder_tools() function.
    @mcp.tool(
        name="delete_folder",
    )
  • The handler function for delete_folder. It accepts a single parameter id_or_path (string), validates it, executes a GraphQL mutation 'deleteFolder' via the graphql_client, and returns the deleted folder's ID or a ToolError on failure.
    def delete_folder(id_or_path: str) -> Union[str, ToolError]:
        """
        Deletes a folder in the content repository. This tool interfaces with the GraphQL API
        to delete a folder object with the provided id.
    
    
        :param id_or_path	string	Yes	The unique identifier or path for the folder. If not provided, an error will be returned.
    
        :returns: If successful, return the folder id.
         Else, return a ToolError instance that describes the error.
        """
        method_name = "delete_folder"
        try:
            # check id or path
            if not id_or_path:
                return ToolError(
                    message=f"delete_folder failed: id is a required input.",
                )
    
            mutation = """
                    mutation deleteFolder( $id_or_path:String!
                    $repo: String!)
                    {
                    deleteFolder(repositoryIdentifier: $repo, 
                        identifier: $id_or_path
                    )
                    {
                        id
                        className
                    }
                    }
            """
            var = {
                "repo": graphql_client.object_store,
                "id_or_path": id_or_path,
            }
            response = graphql_client.execute(query=mutation, variables=var)
            # handling exception, for example duplicate folder name
            if "errors" in response:
                return ToolError(
                    message=f"delete_folder failed: got err {response}.",
                )
    
            return response["data"]["deleteFolder"]["id"]
    
        except Exception as e:
            error_traceback = traceback.format_exc(limit=TRACEBACK_LIMIT)
            logger.error(
                f"{method_name} failed: {e.__class__.__name__} - {str(e)}\n{error_traceback}"
            )
    
            return ToolError(
                message=f"{method_name} failed: got err {e}. Trace available in server logs.",
            )
  • The register_folder_tools function (which registers delete_folder) is called in mcp_server_main.py for the FULL server type.
    register_folder_tools(mcp, graphql_client)
  • The register_folder_tools function (which registers delete_folder) is called in mcp_server_main.py for the CORE server type.
    register_folder_tools(mcp, graphql_client)
Behavior2/5

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

With no annotations, the description carries full burden. It states deletion but doesn't disclose whether it's irreversible, if it requires permissions, or what happens to subfolders.

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

Conciseness3/5

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

The description contains a docstring-style parameter block which adds structure but is slightly verbose. It could be more concise while maintaining clarity.

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 simple delete operation with one parameter and a defined return, the description covers the essential aspects: action, parameter meaning, and return value.

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?

The description explains that id_or_path can be either a unique identifier or a path, adding meaning beyond the schema's type-only definition. This compensates for 0% schema description coverage.

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

Purpose4/5

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

The description clearly states that the tool deletes a folder, which is a specific verb+resource. It distinguishes itself from siblings like create_folder and get_folder_detail.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like update_folder or check if the folder is empty. It lacks explicit context or exclusion criteria.

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