Skip to main content
Glama

delete_database

Remove a specified database from your Turso organization using the MCP server for precise and secure database management.

Instructions

Delete a database from your Turso organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the database to delete

Implementation Reference

  • The core handler function that performs the actual DELETE API request to the Turso platform to delete the specified database.
    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,
    		);
    	}
    }
  • Registers the 'delete_database' tool with the MCP server using server.tool(), providing name, description, input schema, and a thin wrapper handler that calls the organization client implementation.
    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 definition for the delete_database tool input, validating the 'name' parameter with description.
    const DeleteDatabaseSchema = z.object({
    	name: z.string().describe('Name of the database to permanently delete - WARNING: ALL DATA WILL BE LOST FOREVER'),
    });
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose that this is destructive (irreversible deletion), requires specific permissions, has no confirmation step, or mention potential side effects (e.g., data loss, impact on connected services).

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 with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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 crucial context: no warning about irreversible deletion, no mention of required permissions or authentication, no error handling details, and no information on what happens post-deletion (e.g., confirmation message).

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 parameter 'name' documented in the schema. The description adds no additional meaning beyond implying the parameter is for identifying the database, so it meets the baseline of 3 where schema does the heavy lifting.

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 the action ('Delete') and resource ('a database from your Turso organization'), providing specific verb+resource pairing. However, it doesn't differentiate from sibling tools like 'create_database' or 'list_databases' beyond the obvious action difference, missing explicit sibling distinction.

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. The description lacks context about prerequisites (e.g., needing admin permissions), exclusions (e.g., cannot delete if in use), or comparisons to siblings like 'list_databases' for verification before deletion.

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

Related 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