Skip to main content
Glama

generate_table_insights

Analyze table data to uncover patterns, trends, and key statistics using AI-powered analysis for informed decision-making.

Instructions

Generate AI-powered insights about a table's data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes
sample_limitNo

Implementation Reference

  • The core handler function for the 'generate_table_insights' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference from type hints and docstring. Fetches table schema and sample data from Snowflake, then generates AI insights using OpenAI.
    @mcp.tool() async def generate_table_insights(table_name: str, sample_limit: int = 20, ctx: Context = None) -> str: """Generate AI-powered insights about a table's data""" await ctx.info(f"Generating insights for table: {table_name}") try: snowflake = await get_snowflake_client() # Get table schema columns = await snowflake.describe_table(table_name) # Get sample data sample_result = await snowflake.get_table_sample(table_name, sample_limit) if not sample_result.success: await ctx.error(f"Failed to get sample data: {sample_result.error}") return f"Failed to get sample data: {sample_result.error}" # Generate insights openai = await get_openai_client() insights = await openai.generate_data_insights(table_name, columns, sample_result.data) await ctx.info(f"Generated insights for table {table_name}") return insights except Exception as e: logger.error(f"Error generating table insights: {str(e)}") await ctx.error(f"Failed to generate table insights: {str(e)}") raise

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