Skip to main content
Glama

⚠️ DESTRUCTIVE: Permanently deletes a database and ALL its data. Cannot be undone. Always confirm with user before proceeding and verify correct database name.

delete_database

Permanently deletes a database and all its data. This action cannot be undone.

Instructions

⚠️ DESTRUCTIVE: Permanently deletes a database and ALL its data. Cannot be undone. Always confirm with user before proceeding and verify correct database name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the database to permanently delete - WARNING: ALL DATA WILL BE LOST FOREVER

Implementation Reference

  • MCP tool handler for 'delete_database'. Calls organization_client.delete_database(name) and returns success/error response.
    server.tool(
    	{
    		name: 'delete_database',
    		description: `⚠️ DESTRUCTIVE: Permanently deletes a database and ALL its data. Cannot be undone. Always confirm with user before proceeding and verify correct database name.`,
    		schema: DeleteDatabaseSchema,
    	},
    	async ({ name }) => {
    		try {
    			await organization_client.delete_database(name);
    			return create_tool_response({
    				success: true,
    				message: `Database '${name}' deleted successfully`,
    			});
    		} catch (error) {
    			return create_tool_error_response(error);
    		}
    	},
    );
  • Zod schema for the delete_database tool input, requiring a 'name' string describing the database to permanently delete.
    const DeleteDatabaseSchema = z.object({
    	name: z.string().describe('Name of the database to permanently delete - WARNING: ALL DATA WILL BE LOST FOREVER'),
    });
  • Registration of the 'delete_database' tool via server.tool() with name, description, schema and handler callback.
    export function register_tools(server: McpServer<any>): void {
    	// Organization tools
    	server.tool(
    		{
    			name: 'list_databases',
    			description: 'List all databases in your Turso organization',
    			schema: EmptySchema,
    		},
    		async () => {
    			try {
    				const databases = await organization_client.list_databases();
    				return create_tool_response({ databases });
    			} catch (error) {
    				return create_tool_error_response(error);
    			}
    		},
    	);
    
    	server.tool(
    		{
    			name: 'create_database',
    			description: `✓ SAFE: Create a new database in your Turso organization. Database name must be unique.`,
    			schema: CreateDatabaseSchema,
    		},
    		async ({ name, group, regions }) => {
    			try {
    				const database = await organization_client.create_database(
    					name,
    					{ group, regions },
    				);
    				return create_tool_response({ database });
    			} catch (error) {
    				return create_tool_error_response(error);
    			}
    		},
    	);
    
    	server.tool(
    		{
    			name: 'delete_database',
    			description: `⚠️ DESTRUCTIVE: Permanently deletes a database and ALL its data. Cannot be undone. Always confirm with user before proceeding and verify correct database name.`,
    			schema: DeleteDatabaseSchema,
    		},
    		async ({ name }) => {
    			try {
    				await organization_client.delete_database(name);
    				return create_tool_response({
    					success: true,
    					message: `Database '${name}' deleted successfully`,
    				});
    			} catch (error) {
    				return create_tool_error_response(error);
    			}
    		},
    	);
  • API client function that sends a DELETE request to Turso Platform API to permanently delete a database by name.
    export async function delete_database(name: string): Promise<void> {
    	const organization_id = get_organization_id();
    	const url = `${API_BASE_URL}/organizations/${organization_id}/databases/${name}`;
    
    	try {
    		const response = await fetch(url, {
    			method: 'DELETE',
    			headers: get_auth_header(),
    		});
    
    		if (!response.ok) {
    			const errorData = await response.json().catch(() => ({}));
    			const errorMessage = errorData.error || response.statusText;
    			throw new TursoApiError(
    				`Failed to delete database ${name}: ${errorMessage}`,
    				response.status,
    			);
    		}
    	} catch (error) {
    		if (error instanceof TursoApiError) {
    			throw error;
    		}
    		throw new TursoApiError(
    			`Failed to delete database ${name}: ${
    				(error as Error).message
    			}`,
    			500,
    		);
    	}
    }
Behavior4/5

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

With no annotations, the description carries the full burden. It explicitly states the destructive and irreversible nature: 'Permanently deletes' and 'Cannot be undone.' This sufficiently discloses the critical behavior, though it omits details like permissions or error handling. The warning about confirmation adds transparency.

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

Conciseness4/5

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

The description is a single sentence that is repeated from the title, which is concise but slightly redundant. It is front-loaded with a warning. While efficient, it could be more structured (e.g., separate into purpose and caution). Loses a point for repetition.

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

Completeness3/5

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

Given no output schema, the description should clarify what the tool returns (e.g., success confirmation). It lacks details on return value, error states, or post-deletion effects. For a destructive tool with a simple interface, it is moderately complete but could be improved.

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%. The parameter description 'Name of the database to permanently delete - WARNING: ALL DATA WILL BE LOST FOREVER' adds emphasis but does not provide additional semantic meaning beyond the schema. Baseline 3 is appropriate.

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

Purpose2/5

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

Tautological: description restates name/title.

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?

The description provides a strong usage guideline: 'Always confirm with user before proceeding and verify correct database name.' This directs the agent to take caution but does not explicitly state when to avoid using the tool or mention alternatives. The context of sibling tools implies it is only for deletion, so the guideline is clear but not comprehensive.

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/spences10/mcp-turso-cloud'

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