"""{{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

Returns the literal schema, path, method, and documentation for a
specific operationId (PRD §1.5).
"""

from __future__ import annotations

from dataclasses import asdict
from typing import Any

import aiosqlite

from ..core.errors import NotFoundError
from ..data.store import get_endpoint


async def get_operation(conn: aiosqlite.Connection, operation_id: str) -> dict[str, Any]:
    endpoint = await get_endpoint(conn, operation_id)
    if endpoint is None:
        raise NotFoundError(f"unknown operationId '{operation_id}'")
    return asdict(endpoint)
