Skip to main content
Glama
nbbaier

MCP-Turso

list_tables

Retrieve all table names from a Turso-hosted LibSQL database to view available data structures and plan queries.

Instructions

List all tables in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the list_tables tool: logs action, calls listTables helper, returns JSON of tables or error content.
    execute: async () => {
    	try {
    		logger.info("Executing list_tables");
    		const tables = await listTables(db);
    		return content(JSON.stringify({ tables }, null, 2));
    	} catch (error) {
    		logger.error("Failed to list tables", error);
    		return content(
    			`Error listing tables: ${error instanceof Error ? error.message : String(error)}`,
    			true,
    		);
    	}
    },
  • src/index.ts:47-64 (registration)
    Registration of the list_tables tool using server.addTool, including name, description, empty input schema, and handler.
    server.addTool({
    	name: "list_tables",
    	description: "List all tables in the database",
    	parameters: z.object({}),
    	execute: async () => {
    		try {
    			logger.info("Executing list_tables");
    			const tables = await listTables(db);
    			return content(JSON.stringify({ tables }, null, 2));
    		} catch (error) {
    			logger.error("Failed to list tables", error);
    			return content(
    				`Error listing tables: ${error instanceof Error ? error.message : String(error)}`,
    				true,
    			);
    		}
    	},
    });
  • Zod schema for input parameters: empty object (no parameters required).
    parameters: z.object({}),
  • Helper function that queries sqlite_master to list user tables (excluding sqlite_ internals), returns array of table names.
    export async function listTables(client: Client): Promise<string[]> {
    	const result = await client.execute({
    		sql: "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'",
    		args: [],
    	});
    
    	return result.rows.map((row) => row.name 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 tool lists tables but doesn't mention important behavioral aspects like whether it returns metadata, pagination behavior, performance characteristics, or error conditions. This leaves significant gaps for a tool that interacts with a database.

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 any unnecessary words. It's perfectly front-loaded and wastes no space, making it ideal for quick comprehension.

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 database tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what information is returned about each table, whether there are any constraints or limitations, or how this differs from sibling tools. The agent would need to guess about important operational details.

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 with 100% schema description coverage, so the schema already fully documents the input requirements. The description appropriately doesn't add parameter information beyond what's already covered, earning a baseline score of 4 for zero-parameter tools.

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 ('List') and resource ('all tables in the database'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'describe_table' or 'get_db_schema', which prevents a perfect score.

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 about when to use this tool versus alternatives like 'get_db_schema' or 'describe_table'. The description only states what the tool does, leaving the agent to infer usage context without explicit direction.

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