Skip to main content
Glama
wabox32

schema-engram-mcp

by wabox32

db_schema_update

Update an existing database schema snapshot by modifying its JSON structure, metadata, or renaming identifiers while maintaining data integrity.

Instructions

Actualiza una instantánea existente. Debes indicar el mismo workspace_id y connection_name que tenía el registro (sirven como comprobación).

Los argumentos opcionales con valor por defecto en el cliente no aplican cambios salvo que los envíes: schema sustituye el JSON completo; dialect, label y summary solo se escriben si los pasas (cadena vacía → NULL en BD).

new_workspace_id / new_connection_name renombran la instantánea si se indican. Con bump_captured_at=true (por defecto) se actualiza la fecha de la fila.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
snapshot_idYes
workspace_idYes
connection_nameYes
schemaNo
dialectNo
labelNo
summaryNo
new_workspace_idNo
new_connection_nameNo
bump_captured_atNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `db_schema_update` function is the handler for updating existing schema snapshots. It validates input parameters, prepares renaming parameters, calls the `storage.update_snapshot` helper, and returns the result as a JSON string.
    def db_schema_update(
        snapshot_id: int,
        workspace_id: str,
        connection_name: str,
        schema: Any | None = None,
        dialect: str | None = None,
        label: str | None = None,
        summary: str | None = None,
        new_workspace_id: str | None = None,
        new_connection_name: str | None = None,
        bump_captured_at: bool = True,
    ) -> str:
        """
        Actualiza una instantánea existente. Debes indicar el mismo ``workspace_id`` y
        ``connection_name`` que tenía el registro (sirven como comprobación).
    
        Los argumentos opcionales con valor por defecto en el cliente no aplican cambios
        salvo que los envíes: ``schema`` sustituye el JSON completo; ``dialect``, ``label``
        y ``summary`` solo se escriben si los pasas (cadena vacía → NULL en BD).
    
        ``new_workspace_id`` / ``new_connection_name`` renombran la instantánea si se indican.
        Con ``bump_captured_at=true`` (por defecto) se actualiza la fecha de la fila.
        """
        rename_ws: str | None = None
        if new_workspace_id is not None:
            rename_ws = new_workspace_id.strip()
            if not rename_ws:
                return json.dumps({"error": "new_workspace_id no puede estar vacío"}, ensure_ascii=False)
        rename_cn: str | None = None
        if new_connection_name is not None:
            rename_cn = new_connection_name.strip()
            if not rename_cn:
                return json.dumps({"error": "new_connection_name no puede estar vacío"}, ensure_ascii=False)
        row = storage.update_snapshot(
            _get_conn(),
            snapshot_id,
            workspace_id=workspace_id.strip(),
            connection_name=connection_name.strip(),
            schema=schema,
            dialect=dialect,
            label=label,
            summary=summary,
            new_workspace_id=rename_ws,
            new_connection_name=rename_cn,
            bump_captured_at=bump_captured_at,
        )
        if row is None:
            return json.dumps(
                {"error": "no encontrado o workspace/connection no coinciden"},
                ensure_ascii=False,
            )
        return json.dumps(row, ensure_ascii=False)
  • The tool is registered using the `@mcp.tool()` decorator on the `db_schema_update` function.
    @mcp.tool()
    def db_schema_update(
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses important behavioral traits: the update requires matching workspace_id and connection_name for verification, optional parameters only apply changes if sent, schema replaces the entire JSON, empty strings become NULL in the database, new_workspace_id/new_connection_name rename the snapshot, and bump_captured_at updates the row date by default. This covers mutation effects, data handling, and default behavior.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the core purpose. Each sentence adds value: verification requirements, optional parameter behavior, renaming functionality, and date update default. While slightly dense, there's minimal waste, and the structure guides the reader through key aspects efficiently.

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

Completeness4/5

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

Given the complexity (10 parameters, mutation tool, no annotations) and the presence of an output schema (which handles return values), the description is largely complete. It explains verification needs, parameter behaviors, renaming, and date updates. The main gap is lack of explicit error cases or permissions, but it covers most operational context well for an update tool.

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

Parameters5/5

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

With 0% schema description coverage, the description compensates excellently by explaining the semantics of most parameters: workspace_id and connection_name serve as verification, schema replaces the entire JSON, dialect/label/summary only write if passed, new_workspace_id/new_connection_name rename the snapshot, and bump_captured_at updates the date. It adds crucial meaning beyond the bare schema, covering 9 of 10 parameters effectively.

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 'Actualiza una instantánea existente' (Updates an existing snapshot), providing a specific verb (update) and resource (snapshot). It distinguishes from sibling tools like db_schema_delete, db_schema_get, db_schema_list, and db_schema_save by focusing on modification rather than creation, retrieval, listing, or deletion.

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

Usage Guidelines3/5

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

The description implies usage when updating an existing snapshot, mentioning that workspace_id and connection_name serve as verification. However, it doesn't explicitly state when to use this tool versus alternatives like db_schema_save (for creation) or provide clear exclusions. The guidance is contextual but not comprehensive.

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

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