Skip to main content
Glama
lloydzhou

Bitable MCP Server

by lloydzhou

read_query

Execute SQL queries to retrieve data from Bitable tables, enabling structured data access and analysis through the MCP server.

Instructions

read_query by sql

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Implementation Reference

  • The handler function that executes the 'read_query' tool. It runs the SQL query on the Bitable database via a connection pool, retrieves records and column names, and returns them as JSON.
    def read_query(sql: str) -> list[str]: with conn_pool.connect() as connection: cursor = connection.cursor() records = cursor.execute(sql).fetchall() columns = [t[0] for t in cursor.description or []] return json.dumps({ "columns": columns, "records": records, })
  • Registers the 'read_query' tool with the MCP server using the @mcp.tool decorator, including name and description.
    @mcp.tool( name="read_query", description="read_query by sql", )

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/lloydzhou/bitable-mcp'

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