"""Tool registry: the groups, registered in one call. The groups mirror the domain rather than the HTTP routes — papers and paragraphs and sentences are the same tables the REST API serves, but a model reaches for "append a sentence" and "write a whole paper" as different jobs, and the split between :mod:`~app.mcp.tools.papers` and :mod:`~app.mcp.tools.paragraphs` follows those jobs. Prefixes are load-bearing: every tool name starts with its group (``paper_``, ``paragraph_``, ``sentence_``, ``template_``, ``field_``, ``reference_``, ``reference_tag_``, ``image_``), because that prefix is what a model uses to pick a tool out of a list of forty without reading all forty descriptions. """ from __future__ import annotations from mcp.server.mcpserver import MCPServer from app.mcp.tools import ( fields, images, papers, paragraphs, reference_tags, references, sentences, templates, ) #: Registration order is also the order a client lists the tools in, which is #: the order a paper is actually written in: find it, shape it, write it, then #: the things it is written against — and last the figure, which is written by #: putting a sentence somewhere. MODULES = ( papers, paragraphs, sentences, templates, fields, references, reference_tags, images, ) def register_all(server: MCPServer) -> None: """Register every paper-doc tool on ``server``.""" for module in MODULES: module.register(server) __all__ = ["MODULES", "register_all"]