Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

base_databaseList

Retrieve a complete list of all databases within the Teradata System for streamlined database management and analysis using the Teradata MCP Server.

Instructions

Lists all databases in the Teradata System.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that lists databases by executing a fixed SQL query against dbc.DatabasesV, formatting the results into JSON with metadata.
    def handle_base_databaseList(conn: TeradataConnection, *args, **kwargs): """ Lists all databases in the Teradata System. Returns: ResponseType: formatted response with query results + metadata """ logger.debug(f"Tool: handle_base_databaseList: Args: None") sql = "select DataBaseName, DECODE(DBKind, 'U', 'User', 'D','DataBase') as DBType, CommentString from dbc.DatabasesV dv where OwnerName <> 'PDCRADM'" with conn.cursor() as cur: rows = cur.execute(sql) data = rows_to_json(cur.description, rows.fetchall()) metadata = { "tool_name": "base_databaseList", "sql": sql, "columns": [ {"name": col[0], "type": col[1].__name__ if hasattr(col[1], '__name__') else str(col[1])} for col in cur.description ] if cur.description else [], "row_count": len(data) } logger.debug(f"Tool: handle_base_databaseList: metadata: {metadata}") return create_response(data, metadata)
  • The dynamic registration code in the MCP app factory that discovers handle_* functions via module loader, derives tool_name='base_databaseList' from 'handle_base_databaseList', wraps it for MCP compatibility (including schema from function signature), and registers it on the FastMCP server.
    # Register code tools via module loader module_loader = td.initialize_module_loader(config) if module_loader: all_functions = module_loader.get_all_functions() for name, func in all_functions.items(): if not (inspect.isfunction(func) and name.startswith("handle_")): continue tool_name = name[len("handle_"):] if not any(re.match(p, tool_name) for p in config.get('tool', [])): continue # Skip template tools (used for developer reference only) if tool_name.startswith("tmpl_"): logger.debug(f"Skipping template tool: {tool_name}") continue # Skip BAR tools if BAR functionality is disabled if tool_name.startswith("bar_") and not enableBAR: logger.info(f"Skipping BAR tool: {tool_name} (BAR functionality disabled)") continue wrapped = make_tool_wrapper(func) mcp.tool(name=tool_name, description=wrapped.__doc__)(wrapped) logger.info(f"Created tool: {tool_name}") logger.debug(f"Tool Docstring: {wrapped.__doc__}")

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/Teradata/teradata-mcp-server'

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