Skip to main content
Glama

sample_table_data

Extract a defined number of random rows from a specified Azure Data Explorer table to analyze or test data, with a default sample size of 10.

Instructions

Retrieves a random sample of rows from the specified table in the Azure Data Explorer database. The sample_size parameter controls how many rows to return (default: 10).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sample_sizeNo
table_nameYes

Implementation Reference

  • The handler function for the 'sample_table_data' tool. It is decorated with @mcp.tool, which handles registration and schema inference from the function signature. Executes a KQL query to sample rows from the specified table using the Kusto client.
    @mcp.tool(description="Retrieves a random sample of rows from the specified table in the Azure Data Explorer database. The sample_size parameter controls how many rows to return (default: 10).") async def sample_table_data(table_name: str, sample_size: int = 10) -> List[Dict[str, Any]]: """Get sample data from a table.""" logger.info("Sampling table data", table_name=table_name, sample_size=sample_size, database=config.database) if not config.cluster_url or not config.database: logger.error("Missing ADX configuration") raise ValueError("Azure Data Explorer configuration is missing. Please set ADX_CLUSTER_URL and ADX_DATABASE environment variables.") try: client = get_kusto_client() query = f"{table_name} | sample {sample_size}" result_set = client.execute(config.database, query) results = format_query_results(result_set) logger.info("Sample data retrieved successfully", table_name=table_name, row_count=len(results)) return results except Exception as e: logger.error("Failed to sample table data", table_name=table_name, error=str(e), exception_type=type(e).__name__) raise

Other Tools

Related 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/pab1it0/adx-mcp-server'

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