"""MCP tool and prompt definitions for both the local and remote servers."""

from __future__ import annotations

from mcp.server.fastmcp import FastMCP
from mcp.types import ToolAnnotations

from ..client import ApiClient
from ..decorators import track_tool
from . import feedback, knowledge, topics


def register_tools(
    mcp: FastMCP,
    client: ApiClient,
    *,
    source_type: str,
    open_world: bool = False,
) -> None:
    read_hint = ToolAnnotations(readOnlyHint=True, destructiveHint=False, openWorldHint=open_world)
    write_hint = ToolAnnotations(readOnlyHint=False, destructiveHint=False, openWorldHint=open_world)
    track = track_tool(lambda: client)

    topics.register(mcp, client, source_type=source_type, read_hint=read_hint, write_hint=write_hint, track=track)
    knowledge.register(mcp, client, source_type=source_type, read_hint=read_hint, write_hint=write_hint, track=track)
    feedback.register(mcp, client, write_hint=write_hint, track=track)
