Skip to main content
Glama
DeepaRajareddy

Redshift MCP Server

redshift_get_sample_data

Retrieve sample rows from a Redshift table to preview data structure and content before querying.

Instructions

Get sample rows from a table.

Args:
    table_name: Name of the table
    limit: Number of rows to return (default: 5)
    schema: Schema name (default: "public")

Returns:
    JSON sample data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes
limitNo
schemaNopublic

Implementation Reference

  • The main handler function for the 'redshift_get_sample_data' tool. It is decorated with @mcp.tool() which serves as both the implementation and registration in FastMCP. The function generates a SQL query to fetch a limited number of rows from the specified table and delegates execution to the 'redshift_query' tool, returning JSON results.
    @mcp.tool()
    def redshift_get_sample_data(table_name: str, limit: int = 5, schema: str = "public") -> str:
        """
        Get sample rows from a table.
        
        Args:
            table_name: Name of the table
            limit: Number of rows to return (default: 5)
            schema: Schema name (default: "public")
        
        Returns:
            JSON sample data
        """
        sql = f"SELECT * FROM {schema}.{table_name} LIMIT {limit}"
        return redshift_query(sql)

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/DeepaRajareddy/redshift_mcp_server'

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