Skip to main content
Glama
nbbaier

MCP-Turso

get_db_schema

Retrieve the complete database schema to understand table structures and relationships for Turso-hosted LibSQL databases.

Instructions

Get the schema for all tables in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:66-81 (registration)
    Registration of the 'get_db_schema' tool, which calls the dbSchema helper function from utils.ts and formats the result as JSON content.
    server.addTool({
    	name: "get_db_schema",
    	description: "Get the schema for all tables in the database",
    	parameters: z.object({}),
    	execute: async () => {
    		try {
    			const schema = await dbSchema(db);
    			return content(JSON.stringify({ schema }, null, 2));
    		} catch (error) {
    			return content(
    				`Error getting schema: ${error instanceof Error ? error.message : String(error)}`,
    				true,
    			);
    		}
    	},
    });
  • Core handler logic for retrieving SQL CREATE statements for all user tables from sqlite_master.
    export async function dbSchema(client: Client): Promise<string[]> {
    	const result = await client.execute({
    		sql: "SELECT sql FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'",
    		args: [],
    	});
    
    	return result.rows.map((row) => row.sql as string);
    }
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 action ('Get') but lacks details on permissions, rate limits, response format, or potential side effects. For a tool that likely returns structured data, this is a significant gap in transparency.

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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's purpose.

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 (a tool that likely returns database metadata), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the schema includes (e.g., table names, columns, types) or the return format, leaving significant 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.

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned if any implicit parameters (e.g., database connection) are assumed. Baseline for 0 params is 4.

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 ('Get') and resource ('schema for all tables in the database'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'describe_table' or 'list_tables', which might provide similar or overlapping functionality.

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 such as 'describe_table' or 'list_tables'. The description implies a broad scope ('all tables'), but it doesn't specify prerequisites, exclusions, or contextual recommendations for choosing this tool over others.

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

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