Skip to main content
Glama
gigapi

GigAPI MCP Server

by gigapi

get_table_schema

Retrieve schema details for a specific table within GigAPI MCP Server, enabling structured querying and management of timeseries data in GigAPI Timeseries Lake.

Instructions

Get schema information for a specific table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_dataYes

Implementation Reference

  • Main handler function in GigAPITools class that executes the get_table_schema tool logic by calling the client method and formatting the response with success/error handling.
    def get_table_schema(self, database: str, table: str) -> Dict[str, Any]: """Get table schema information. Args: database: The name of the database table: The name of the table Returns: Table schema information """ try: schema = self.client.get_table_schema(database, table) return { "schema": schema, "success": True, "database": database, "table": table } except GigAPIClientError as e: logger.error(f"Failed to get table schema: {e}") return { "error": str(e), "success": False, "database": database, "table": table }
  • Registration of the 'get_table_schema' MCP tool using FastMCP's Tool.from_function, wrapping the handler with a lambda to parse input_data.
    Tool.from_function( lambda input_data: tools_instance.get_table_schema( input_data["database"], input_data.get("table", "") ), name="get_table_schema", description="Get schema information for a specific table.", ),
  • Core helper method in GigAPIClient that implements the schema retrieval by executing a 'DESCRIBE {table}' SQL query via execute_query.
    def get_table_schema(self, database: str, table: str) -> List[Dict[str, Any]]: """Get table schema information. Args: database: Database name table: Table name Returns: List of column information """ query = f"DESCRIBE {table}" response = self.execute_query(query, database) if response.error: raise GigAPIClientError(f"Failed to get table schema: {response.error}") return response.results

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/gigapi/gigapi-mcp'

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