Skip to main content
Glama
nbbaier

MCP-Turso

describe_table

View schema information for a specific table in a Turso-hosted LibSQL database to understand its structure and columns.

Instructions

View schema information for a specific table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table to describe

Implementation Reference

  • Core handler function that executes PRAGMA table_info to retrieve and map detailed column information for the specified table.
    export async function describeTable(
    	tableName: string,
    	client: Client,
    ): Promise<TableColumn[]> {
    	if (!/^[a-zA-Z0-9_]+$/.test(tableName)) {
    		throw new Error(
    			"Invalid table name. Only alphanumeric characters and underscores are allowed.",
    		);
    	}
    
    	const result = await client.execute({
    		sql: `PRAGMA table_info(${tableName})`,
    		args: [],
    	});
    
    	if (result.rows.length === 0) {
    		throw new Error(`Table '${tableName}' not found`);
    	}
    
    	return result.rows.map((row) => ({
    		name: row.name as string,
    		type: row.type as string,
    		notnull: row.notnull as number,
    		dflt_value: row.dflt_value as string | null,
    		pk: row.pk as number,
    	}));
    }
  • src/index.ts:83-105 (registration)
    Registers the describe_table tool with FastMCP server, defining name, description, input parameters schema, and execute wrapper that calls the handler.
    server.addTool({
    	name: "describe_table",
    	description: "View schema information for a specific table",
    	parameters: z.object({
    		table_name: z
    			.string()
    			.describe("Name of the table to describe")
    			.min(1, "Table name is required"),
    	}),
    	execute: async ({ table_name }) => {
    		try {
    			logger.info(`Executing describe_table for table: ${table_name}`);
    			const schema = await describeTable(table_name, db);
    			return content(JSON.stringify({ schema }, null, 2));
    		} catch (error) {
    			logger.error(`Failed to describe table ${table_name}`, error);
    			return content(
    				`Error describing table: ${error instanceof Error ? error.message : String(error)}`,
    				true,
    			);
    		}
    	},
    });
  • Zod schema and TypeScript type definition for TableColumn, used as the return type of the describeTable handler.
    export const TableColumnSchema = z.object({
    	name: z.string(),
    	type: z.string(),
    	notnull: z.number(),
    	dflt_value: z.union([z.string(), z.null()]),
    	pk: z.number(),
    });
    
    export type TableColumn = z.infer<typeof TableColumnSchema>;
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 implies a read-only operation ('View'), but does not specify permissions, rate limits, error handling, or what 'schema information' entails (e.g., columns, types, constraints). This leaves significant gaps for a tool with mutation potential.

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 is front-loaded and wastes no words. It directly conveys the core purpose without unnecessary elaboration, earning full marks for conciseness.

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 lack of annotations and output schema, the description is incomplete. It does not explain what 'schema information' includes or the return format, which is crucial for a tool that likely provides structured data. This leaves the agent with insufficient context for effective use.

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 input schema has 100% description coverage, with the parameter 'table_name' well-documented. The description adds no additional meaning beyond the schema, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating value.

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 verb ('View') and resource ('schema information for a specific table'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'get_db_schema' or 'list_tables', which might also provide schema-related information, so it misses the highest 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?

The description provides no guidance on when to use this tool versus alternatives such as 'get_db_schema' or 'list_tables'. It lacks context on prerequisites, exclusions, or specific scenarios, leaving the agent without clear usage instructions.

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