Yichus / Reference / API MCP tools
api_abstraction_map
Draw the program's abstraction ladder: every definition placed at its abstraction height (layer 0 = built only from builtins; each layer composes the ones below), with reuse (fan-in), width (direct dependencies), mass (size: node count of the compiled definition), duplication (shape-isomorphic blocks repeated inside a definition, each listed in repeatedBlocks with every instance's source location, and copy-paste clone pairs across definitions), higher-order generators, curried specializations, and semantic policy objects (abstractionStructure), and layer-skipping edges measured. Optional peer_sources and peer_side attach the computed before/after organization diff (peerDiff), and optional peer_style (board, wires, strata, matrix, or brief) renders a side-by-side before/after SVG diagram at peerDiff.svg. Every visual quantity is a defined function of the source's dependency graph and the layout is deterministic, so you can inspect reuse and layer crossings. The layout does not score organization or establish that one graph shape is best. On the browser MCP page this tool also renders the map for the user, so sending sources here changes what they see.
Kind: AbstractionMap. Family orientation: MCP servers list it once api_tools opens that family. Origin: Yichus/Mcp::catalog.
CLI: yichus organize map — the same abstraction map, the CLI's map lens.
Parameters
sources(required, array) — JSON array of {fileName, source} Bosatsu files for the module.peer_sources(optional, array) — Optional JSON array of {fileName, source} for a peer version (before or after) so the response includes peerDiff.peer_side(optional, string) — With peer_sources: whether peer_sources is before or after (default after, so sources is the opposite side).peer_style(optional, string) — With peer_sources: optional visual style for a standalone before/after SVG diagram at peerDiff.svg — board (3-tier whiteboard: entry points on top, shared rules in the middle with helpers folded in, domain data at the bottom; suits explaining a refactor to a teammate), wires (layered call graph; suits tracing direct call arrows and skip-layer lanes), strata (stacked layer shelves without crossing wires; suits comparing layer height and reuse), matrix (caller-by-callee grid; suits auditing dense call tables), or brief (compact change cards that draw only the change and its direct neighbours and count the rest, at one reading width; suits a pull request summary, even in a large program).
Read the result according to this tool’s scope: static checks, bounded execution checks, and descriptive diagrams answer different questions. A successful call is not a general approval of the program. The safety and permissions guide compares the checks and provides editable ownership, guard, and role examples.