Skip to main content
Glama
OpenLinkSoftware

mcp-sqlalchemy

podbc_get_tables

Retrieve a list of tables and their details from a specified database schema using SQLAlchemy connectivity. Automatically defaults to the connection schema if none is provided.

Instructions

Retrieve and return a list containing information about tables in specified schema, if empty uses connection default

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
SchemaNo
urlNo

Implementation Reference

  • Registers the 'podbc_get_tables' tool using the @mcp.tool decorator with name and description.
    @mcp.tool(
        name="podbc_get_tables",
        description="Retrieve and return a list containing information about tables in specified schema, if empty uses connection default"
    )
  • The handler function that connects to the ODBC database, executes cursor.tables() to fetch tables in the specified catalog/schema, collects TABLE_CAT, TABLE_SCHEM, TABLE_NAME into a list of dicts, and returns formatted JSON.
    def podbc_get_tables(Schema: Optional[str] = None, user:Optional[str]=None, 
                        password:Optional[str]=None, dsn:Optional[str]=None) -> str:
        """
        Retrieve and return a list containing information about tables.
    
        If `schema` is None, returns tables for all schemas.
        If `schema` is not None, returns tables for the specified schema.
    
        Args:
            schema (Optional[str]): The name of the schema to retrieve tables for. If None, retrieves tables for all schemas.
            user (Optional[str]=None): Optional username.
            password (Optional[str]=None): Optional password.
            dsn (Optional[str]=None): Optional dsn name.
    
        Returns:
            str: A list containing information about tables.
        """
        cat = "%" if Schema is None else Schema
        try:
            with get_connection(True, user, password, dsn) as conn:
                cursor = conn.cursor()
                rs = cursor.tables(table=None, catalog=cat, schema="%", tableType="TABLE");
                results = []
                for row in rs:
                    results.append({"TABLE_CAT":row[0], "TABLE_SCHEM":row[1], "TABLE_NAME":row[2]})
                    
                return json.dumps(results, indent=2)
        except pyodbc.Error as e:
            logging.error(f"Error retrieving tables: {e}")
            raise
Behavior2/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. It mentions the action 'retrieve and return' but doesn't disclose behavioral traits such as read-only vs. destructive nature, authentication requirements, rate limits, error handling, or output format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with zero waste. It's front-loaded with the core purpose and includes essential conditional behavior. Every word earns its place, making it highly concise and well-structured.

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

Completeness2/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 (2 parameters, database interaction), lack of annotations, and no output schema, the description is incomplete. It doesn't cover return values, error cases, or behavioral details needed for safe and effective use. The description should do more to compensate for missing structured data.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It implies the 'Schema' parameter's purpose ('specified schema') and default behavior ('if empty uses connection default'), but doesn't explain the 'url' parameter at all. With 2 parameters and incomplete coverage, the description adds only marginal value beyond the bare schema.

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 verb 'retrieve and return' and the resource 'list containing information about tables in specified schema'. It distinguishes the scope by mentioning 'if empty uses connection default', which helps differentiate it from siblings like podbc_filter_table_names or podbc_get_schemas. However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.

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 siblings like podbc_get_schemas for schema listing or podbc_filter_table_names for filtered table names, nor does it specify prerequisites or exclusions. This leaves the agent without context for tool selection.

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

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/OpenLinkSoftware/mcp-sqlalchemy-server'

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