Skip to main content
Glama

delete_space

Remove a workspace and all its contents using the space's unique identifier (DUID).

Instructions

Delete a space and all its contents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_duidYesDUID of the space to delete

Implementation Reference

  • src/index.ts:497-510 (registration)
    Registration of the 'delete_space' tool in the listTools handler, including its input schema.
            name: 'delete_space',
            description: 'Delete a space and all its contents',
            inputSchema: {
                type: 'object',
                properties: {
                    space_duid: {
                        type: 'string',
                        description: 'DUID of the space to delete'
                    }
                },
                required: ['space_duid']
            }
        }
    ];
  • The handler for 'delete_space' tool. It generates Python code that uses the Dart client to create a DELETE operation on the SPACE model with the given space_duid and executes it via transact with SPACE_DELETE transaction kind.
                    case 'delete_space': {
                        console.error('[Debug] Handling delete_space request');
                        const pythonCode = `    # Delete space
    print("[Debug] Starting space deletion", file=sys.stderr)
    try:
        # Parse space_duid from args
        space_duid = "${args.space_duid}"
        print(f"[Debug] Deleting space with DUID: {space_duid}", file=sys.stderr)
    
        # Create the delete operation
        delete_op = Operation(
            model=OperationModelKind.SPACE,
            kind=OperationKind.DELETE,
            data={"duid": space_duid}  # For delete operations, we just need the DUID
        )
        print("[Debug] Created delete operation", file=sys.stderr)
        
        # Execute the transaction
        print("[Debug] Executing transaction", file=sys.stderr)
        response = client.transact([delete_op], TransactionKind.SPACE_DELETE)
        print("[Debug] Transaction completed", file=sys.stderr)
        
        if response.results and response.results[0].success:
            print(f"Space {space_duid} deleted successfully")
            print(f"[Debug] Space deletion successful", file=sys.stderr)
        else:
            print("[Debug] Space deletion failed", file=sys.stderr)
            if response.results:
                print(f"[Debug] Result: {response.results[0]}", file=sys.stderr)
            sys.exit(1)
            
    except Exception as e:
        print(f"[Debug] Error deleting space: {str(e)}", file=sys.stderr)
        print("[Debug] Error type:", type(e), file=sys.stderr)
        traceback.print_exc(file=sys.stderr)
        sys.exit(1)`;
    
                        // Add proper indentation to the Python code
                        const command = pythonCode.split('\n').map(line => {
                            if (line.trim().length === 0) return line;
                            return '    ' + line;
                        }).join('\n');
    
                        console.error('[Debug] Running Python command for space deletion');
                        const output = await this.runDartCommand(command);
                        console.error('[Debug] Space deletion output:', output);
                        const response = {
                            content: [{
                                type: 'text',
                                text: output,
                            }],
                        };
                        return response;
                    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool deletes 'a space and all its contents,' which implies destructive behavior, but lacks details on permissions needed, whether deletion is reversible, confirmation prompts, or error conditions. The description adds minimal behavioral context beyond the basic action.

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?

The description is a single, efficient sentence that front-loads the core action ('Delete a space') and adds critical scope ('and all its contents') without unnecessary words. Every part of the sentence earns its place by clarifying the tool's impact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks information on permissions, reversibility, success/error responses, or dependencies (e.g., cannot delete default spaces). Given the high-risk nature of deletion, more context is needed to guide safe usage.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'space_duid' documented as 'DUID of the space to delete.' The description does not add any additional meaning beyond what the schema provides, such as format examples or validation rules, so it meets the baseline for high schema coverage.

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?

The description clearly states the specific action ('Delete') and resource ('a space and all its contents'), distinguishing it from sibling tools like create_space, update_task, or get_folders. It precisely communicates the destructive nature of the operation beyond just the space itself.

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 or prerequisites for deletion. While the destructive nature is implied, there's no explicit mention of when-not conditions (e.g., irreversible, requires permissions) or alternatives like archiving instead of deleting.

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/jmanhype/dart-mcp-server'

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