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",
    )
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description reveals nothing about what this tool actually does behaviorally - whether it executes SQL queries, what permissions are required, whether it's read-only or has side effects, what happens with invalid SQL, or what format results are returned in. 'read_query by sql' is completely inadequate for a tool that presumably executes database queries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just three words, this is under-specification rather than effective conciseness. The description is so sparse that it fails to communicate essential information. Every word should earn its place, but here the words don't provide enough value to justify their inclusion - they create ambiguity rather than clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a SQL query execution tool with no annotations, no output schema, and a single undocumented parameter, the description is completely inadequate. It doesn't explain what the tool returns, what errors might occur, what database context it operates in, or any behavioral characteristics. This leaves the agent with insufficient information to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and one required parameter (sql), the description provides no meaningful information about the parameter. It doesn't explain what SQL syntax is expected, what database it runs against, whether it supports parameterized queries, or any constraints on the SQL. The description fails completely to compensate for the lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'read_query by sql' is a tautology that essentially restates the tool name with minimal additional information. It mentions 'read' and 'sql' but doesn't specify what resource is being read (tables? databases? specific data?), nor does it distinguish this tool from its siblings (describe_table, list_table). The purpose remains vague rather than specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is absolutely no guidance about when to use this tool versus the sibling tools (describe_table, list_table). The description provides no context about appropriate use cases, prerequisites, or alternatives. This leaves the agent with no information to make an informed selection between available tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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