Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

describe_table

Retrieve table structure and details from Baidu Vector Database to understand schema, fields, and configuration for data operations.

Instructions

Describe table details in the Mochow instance.

Args:
    table_name (str): Name of the table to describe.

Returns:
    str: A string containing the details of the table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Implementation Reference

  • The primary handler function for the 'describe_table' MCP tool. Decorated with @mcp.tool() for automatic registration. It fetches table details using the connector's describe_table_info method and returns a formatted string description.
    @mcp.tool()
    async def describe_table(table_name: str, ctx: Context = None) -> str:
        """
        Describe table details in the Mochow instance.
    
        Args:
            table_name (str): Name of the table to describe.
    
        Returns:
            str: A string containing the details of the table.
        """
        connector = ctx.request_context.lifespan_context.connector
        details = await connector.describe_table_info(table_name)
        return f"Table details named '{table_name}' in Mochow instance:\n{str(details)}"
  • Supporting helper method in the MochowConnector class that interfaces with the underlying pymochow database to retrieve and return table schema/details as a dictionary.
    async def describe_table_info(self, table_name: str) -> dict:
        """
        Get detailed information about a table.
    
        Args:
            table_name (str): Name of the table.
    
        Returns:
            dict: A dictionary containing table details.
        """
        if self.database is None:
            raise ValueError("Switch to the database before describe table")
        try:
            return self.database.describe_table(table_name).to_dict()
        except Exception as e:
            raise ValueError(f"Failed to get table detail info: {str(e)}")
  • The @mcp.tool() decorator on the describe_table function registers it as an MCP tool with FastMCP.
    @mcp.tool()
  • Input schema defined by function signature (table_name: str) and docstring; output is str.
    async def describe_table(table_name: str, ctx: Context = None) -> str:
        """
        Describe table details in the Mochow instance.
    
        Args:
            table_name (str): Name of the table to describe.
    
        Returns:
            str: A string containing the details of the table.
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns 'a string containing the details of the table,' which gives some insight into output format. However, it doesn't cover important aspects like whether this is a read-only operation (likely, but not stated), error conditions (e.g., if the table doesn't exist), or performance characteristics. For a tool with zero annotation coverage, this is insufficient.

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

Conciseness5/5

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

The description is well-structured and concise. It starts with a clear purpose statement, followed by dedicated 'Args' and 'Returns' sections that efficiently document inputs and outputs. Every sentence earns its place with no wasted words, making it easy to scan and understand.

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

Completeness3/5

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

Given the tool's moderate complexity (single parameter, no annotations, no output schema), the description is partially complete. It covers the basic purpose and parameter semantics adequately, but lacks usage guidelines and full behavioral transparency. The absence of an output schema means the description should ideally explain return values more thoroughly, which it does only at a high level.

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

Parameters3/5

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

The schema description coverage is 0%, so the description must compensate. It explicitly documents the single parameter 'table_name' with its type and purpose, which adds meaningful context beyond the bare schema. However, it doesn't provide examples, constraints (e.g., case sensitivity), or format details, leaving some gaps in understanding.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Describe table details in the Mochow instance.' It specifies the verb ('describe') and resource ('table details'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'list_tables' or 'stats_table', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'describe_table' over similar tools like 'list_tables' (which might list table names) or 'stats_table' (which might provide statistical information). There's also no mention of prerequisites, such as whether a database needs to be selected first using 'use_database'.

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/baidu/mochow-mcp-server-python'

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