Context-Scoped Function Invocation Reliable Tool Use for LLM Agents via Executable Markdown
AbstractAn agent with a hundred tools does not have a hundred capabilities; it has a hundred ways to choose wrongly. Contemporary stacks hand the model a flat, global tool registry and ask it to discriminate among descriptions written by different authors to be individually accurate rather than mutually distinguishable. Selection error follows, and it is usually treated as a modelling problem. This paper argues that the difficulty lies in scoping rather than in description, and the candidate set need not be global. We propose Context-scoped function invocation, which derives the functions admissible at a program point from the document's own structure—its imports, its marked calls, and the narration that scopes the step—and enforces that boundary in the compiler. The unit that executes is a section of a Markdown document: there is no schema artifact, no registry entry and no generated code, because the document is already the program. Author's Note on Core Contributions & AI UsageTo ensure transparency for the reader and the community, the author explicitly declares the boundary between human research and AI-assisted engineering: Human Core Contributions: The fundamental research ideas, the core architectural concepts (including the "Re-derivation Tax" and "Context-Scoped Function Invocation"), the Marqdo language design, the nineteen-construct surface, and the trust ledger presented in this paper are entirely the original work of the human researcher. AI-Assisted Implementation & Drafting: AI coding tools were utilized to assist in writing portions of the Rust interpreter and standard library under the human author's strict design specification and test suites. AI language tools were used for structural editing, prose polishing, and reference formatting of the manuscript. Responsibility: No AI system is listed as an author. The human author has reviewed every claim, verified every behavioral mechanism against the running source tree, and takes full responsibility for the accuracy and integrity of the entire manuscript. Code & Runtime AvailabilityThe Marqdo runtime (v2.7.0), standard library, and documentation are released as open-source software.Project Site: https://www.cflmy.top/marqdo/GitHub Repository: https://github.com/cflmy/marqdo
Authors
- Jiaxiang Wang (ORCID: https://orcid.org/0000-0002-9926-3315)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-11
- DOI
- https://doi.org/10.5281/zenodo.24132129
- Primary Topic
- Logic, programming, and type systems
- Type
- preprint