Skip to main content
Glama
rickyb30

DataPilot MCP Server

by rickyb30

list_schemas

Retrieve all database schemas to explore available data structures and organize information for analysis.

Instructions

List all schemas in a database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function for 'list_schemas'. It retrieves schemas for a given database using the SnowflakeClient and provides user feedback via context.
    @mcp.tool()
    async def list_schemas(database: str, ctx: Context) -> List[str]:
        """List all schemas in a database"""
        await ctx.info(f"Retrieving schemas for database: {database}")
        
        try:
            client = await get_snowflake_client()
            schemas = await client.list_schemas(database)
            await ctx.info(f"Found {len(schemas)} schemas in {database}")
            return schemas
            
        except Exception as e:
            logger.error(f"Error listing schemas: {str(e)}")
            await ctx.error(f"Failed to list schemas: {str(e)}")
            return []
  • Helper method in SnowflakeClient that executes the SHOW SCHEMAS SQL query and extracts schema names.
    async def list_schemas(self, database: str) -> List[str]:
        """List all schemas in a database"""
        result = await self.execute_query(f"SHOW SCHEMAS IN DATABASE {database}")
        return [row.get('name', '') for row in result.data if result.success]
  • src/main.py:122-122 (registration)
    The @mcp.tool() decorator registers the list_schemas function as an MCP tool.
    @mcp.tool()
  • MCP resource that also uses list_schemas functionality for snowflake://schemas/{database}.
    @mcp.resource("snowflake://schemas/{database}")
    async def get_schemas_resource(database: str) -> List[str]:
        """Resource to get list of schemas in a database"""
        try:
            client = await get_snowflake_client()
            return await client.list_schemas(database)
        except Exception as e:
            logger.error(f"Error getting schemas resource: {str(e)}")
            return []
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 ('List all schemas') but doesn't describe how the listing works—whether it returns all schemas at once, uses pagination, requires specific permissions, or has rate limits. For a tool with zero annotation coverage, 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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, 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.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is somewhat complete for basic understanding. However, it lacks details on usage context, parameter meaning, and behavioral traits, which are needed for effective tool selection and invocation in a database environment with multiple listing tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, meaning the parameter 'database' is undocumented. The description doesn't add any meaning beyond the schema—it doesn't explain what 'database' refers to (e.g., a database name, ID, or connection string) or provide examples. This fails to compensate for the low 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 verb ('List') and resource ('all schemas in a database'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'list_databases' or 'list_tables', which perform similar listing operations on different resources, so it doesn't reach 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 like 'list_databases' or 'list_tables'. It doesn't mention prerequisites, such as needing to know the database name first, or contextual factors like performance implications. This leaves the agent without clear usage 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/rickyb30/datapilot-mcp-server'

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