Skip to main content
Glama
wabox32

schema-engram-mcp

by wabox32

db_schema_get

Retrieve saved database schema snapshots to access table structures and metadata. Specify workspace and connection to get the latest schema or a specific snapshot by ID.

Instructions

Obtiene un esquema guardado. Si snapshot_id es None, devuelve el más reciente para workspace_id + connection_name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idYes
connection_nameYes
snapshot_idNo

Implementation Reference

  • The tool `db_schema_get` is registered and implemented in `server.py`. It handles retrieving a database schema snapshot by ID or the most recent one.
    @mcp.tool()
    def db_schema_get(
        workspace_id: str,
        connection_name: str,
        snapshot_id: int | None = None,
    ) -> str:
        """
        Obtiene un esquema guardado. Si `snapshot_id` es None, devuelve el más reciente
        para workspace_id + connection_name.
        """
        conn = _get_conn()
        if snapshot_id is not None:
            row = storage.get_snapshot_by_id(conn, snapshot_id)
            if row is None:
                return json.dumps({"error": "snapshot not found"}, ensure_ascii=False)
            if row["workspace_id"] != workspace_id.strip() or row["connection_name"] != connection_name.strip():
                return json.dumps(
                    {"error": "snapshot_id no coincide con workspace/connection"},
                    ensure_ascii=False,
                )
        else:
            row = storage.get_latest(
                conn, workspace_id=workspace_id.strip(), connection_name=connection_name.strip()
            )
            if row is None:
                return json.dumps({"error": "no hay instantáneas"}, ensure_ascii=False)
        return json.dumps(row, ensure_ascii=False)

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/wabox32/schema-mcp'

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