Yichus / Reference / API MCP tools
api_yir
Export the canonical YIR (Yichus IR) of a program: the versioned artifact other tooling reads, with its schema version, packages and binding count. Well-formedness is a refusal, not a warning -- an ill-formed export is never returned, because the point of the artifact is that its shape can be trusted. Same job as yichus yir, which writes it to a file; this returns it.
Kind: Yir. Origin: Yichus/Mcp::catalog.
CLI: yichus yir — the same canonical export and the same well-formedness refusal; the CLI writes the file, the tool returns it.
Parameters
sources(required, array) — JSON array of {fileName, source} Bosatsu files to export.
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.