yera.tools.mcp.catalogue

Rebuildable SQLite catalogue for discovered MCP tools.

Symbols

class MCPServerRecord — Metadata retained for one imported MCP server.
class MCPToolRecord — Metadata retained for one tool discovered from an MCP server.
class SQLiteMCPCatalogue — Cache discovered MCP metadata in a persistent, rebuildable database.

MCPServerRecord

Metadata retained for one imported MCP server.

MCPToolRecord

Metadata retained for one tool discovered from an MCP server.

Methods

from_discovered_tool — Build a catalogue record from MCP discovery metadata.

MCPToolRecord.from_discovered_tool

from_discovered_tool(
    server_name: str,
    tool: Tool,
) → Self

Build a catalogue record from MCP discovery metadata.

Parameters

server_name
type: str

Yera's configured name for the supplying server.

tool
type: Tool

Tool definition returned by the MCP server.

Returns

type: Self

A serializable catalogue record retaining the discovered metadata.

SQLiteMCPCatalogue

Cache discovered MCP metadata in a persistent, rebuildable database.

Methods

__enter__ — Open the catalogue, rebuilding unsupported schemas.
__exit__ — Close the catalogue connection.
replace_server — Atomically replace one server and all its discovered tools.
remove_server — Atomically remove one server and all its discovered tools.
tools_for_server — Return one server's imported tools ordered by tool name.

SQLiteMCPCatalogue.__enter__

__enter__() → SQLiteMCPCatalogue

Open the catalogue, rebuilding unsupported schemas.

SQLiteMCPCatalogue.__exit__

__exit__(
    exc_type: type[BaseException] | None,
    exc_value: BaseException | None,
    traceback: TracebackType | None,
) → None

Close the catalogue connection.

SQLiteMCPCatalogue.replace_server

replace_server(
    server: MCPServerRecord,
    tools: list[MCPToolRecord],
) → None

Atomically replace one server and all its discovered tools.

SQLiteMCPCatalogue.remove_server

remove_server(
    server_name: str,
) → None

Atomically remove one server and all its discovered tools.

SQLiteMCPCatalogue.tools_for_server

tools_for_server(
    server_name: str,
) → list[MCPToolRecord]

Return one server's imported tools ordered by tool name.