Skip to main content
Glama

create_database

Create a new database in your Turso organization by specifying the name, optional group, and regions for deployment using the MCP server.

Instructions

Create a new database in your Turso organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupNoOptional group name for the database
nameYesName of the database to create
regionsNoOptional list of regions to deploy the database to

Implementation Reference

  • MCP tool handler function that calls the organization client to create the database and returns formatted success/error response.
    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);
    	}
    },
  • Zod schema for validating input parameters to the create_database tool.
    const CreateDatabaseSchema = z.object({
    	name: z.string().describe('Name of the database to create - Must be unique within organization'),
    	group: z.string().optional().describe('Optional group name for the database (defaults to "default")'),
    	regions: z.array(z.string()).optional().describe('Optional list of regions to deploy the database to (affects latency and compliance)'),
    });
  • Configuration object passed to server.tool() for registering the create_database tool, including name, description, and schema reference.
    {
    	name: 'create_database',
    	description: `✓ SAFE: Create a new database in your Turso organization. Database name must be unique.`,
    	schema: CreateDatabaseSchema,
    },
  • Helper function in organization client that makes the actual POST request to Turso API to create the database.
    export async function create_database(
    	name: string,
    	options: {
    		group?: string;
    		regions?: string[];
    	} = {},
    ): Promise<Database> {
    	const organization_id = get_organization_id();
    	const url = `${API_BASE_URL}/organizations/${organization_id}/databases`;
    
    	// Default to "default" group if not specified
    	const group = options.group || 'default';
    
    	try {
    		const response = await fetch(url, {
    			method: 'POST',
    			headers: {
    				...get_auth_header(),
    				'Content-Type': 'application/json',
    			},
    			body: JSON.stringify({
    				name,
    				group,
    				regions: options.regions,
    			}),
    		});
    
    		if (!response.ok) {
    			const errorData = await response.json().catch(() => ({}));
    			const errorMessage = errorData.error || response.statusText;
    			throw new TursoApiError(
    				`Failed to create database ${name}: ${errorMessage}`,
    				response.status,
    			);
    		}
    
    		return await response.json();
    	} catch (error) {
    		if (error instanceof TursoApiError) {
    			throw error;
    		}
    		throw new TursoApiError(
    			`Failed to create database ${name}: ${
    				(error as Error).message
    			}`,
    			500,
    		);
    	}
    }
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 creates a database but doesn't mention potential side effects (e.g., resource allocation, billing implications), authentication requirements, rate limits, or what happens on failure (e.g., duplicate names). This is a significant gap for a mutation tool with zero annotation coverage.

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 directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

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?

Given the complexity of creating a database (a mutation operation) and the lack of annotations and output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., success confirmation, database ID), error conditions, or behavioral nuances, leaving critical gaps for an AI agent to use it effectively.

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?

The schema description coverage is 100%, so the input schema already documents all three parameters (name, group, regions) with clear descriptions. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or constraints, but this is acceptable given the high schema 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 the action ('Create') and resource ('new database in your Turso organization'), making the purpose immediately understandable. It distinguishes from siblings like 'list_databases' or 'delete_database' by specifying creation. However, it doesn't explicitly differentiate from other creation-related tools that might exist in the broader context.

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?

The description provides no guidance on when to use this tool versus alternatives like 'list_databases' for checking existing databases or 'delete_database' for removal. There's no mention of prerequisites, such as needing organization permissions or when creation might fail, leaving usage context implicit at best.

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